i am trying to draw curve in java. i don't want quadratic or cubic curve. when i am drawing, it should display curve instead of line.
and i am using (x,y),(last_x,last_y),(x1,y1) coordinates.
What I have tried:
if (pen_type==1){
g2.fillOval( x, y, stroke_width, stroke_width );
} else if (pen_type==2) {
g2.draw(new Line2D.Double(x, y, stroke_width, stroke_width));
}
else {
g2.setStroke(new BasicStroke(stroke_width, BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
g2.drawLine(last_x, last_y,x,y);
QuadCurve2D.Double curve = new QuadCurve2D.Double(last_x, last_y,x1,y1,x,y);
g2.draw(curve);
};