title: how to set the coordinates of points?
body: <p>I need to draw a figure that has 4 segments and there are 4 coordinates in each segment. I wrote a code, but it takes only 3 coordinates as input, how can I make it take 4 coordinates?</p>
  <pre><code>import java.awt.*;
  import java.awt.geom.*;
  import javax.swing.*;
  
  public class Drawing extends JComponent {
      public Drawing() {
      }
      @Override
      protected void paintComponent(Graphics g) {
          Graphics2D g2d = (Graphics2D) g;
  
          RenderingHints rh = new RenderingHints(
                  RenderingHints.KEY_ANTIALIASING,
                  RenderingHints.VALUE_ANTIALIAS_ON);
          g2d.setRenderingHints(rh);
  
          Path2D.Double curve = new Path2D.Double();
           curve.moveTo(300,400); // curve.moveTo(arr[0], arr[1]);
          curve.curveTo(254,47,159,84,123,158); //coordinates
          curve.curveTo(131,258,139,358,167,445);
          g2d.draw(curve);
  </code></pre>