8

I have drawn a quadratic curve using the QuadCurve2d in java using start, end and one control points. Is there a way I can find out the equation of this curve? The reason why I need is that at some point of this curve it might intersect a circle and I want to know their point of intersection. So basically I want to solve two equations, but I dont know the equation of the curve generated by QuadCurve2D. Any help will be appreicated.

Regards S

Shehroz
  • 81
  • 2

3 Answers3

4

See the Javadoc for java.awt.geom.PathIterator, specifically the SEG_QUADTO field, in which the control equation in terms of the start, end and control points is given.

lhballoti
  • 806
  • 7
  • 17
0

That function uses a quadratic bezier curve:

quadratic Bezier formula

You can find it on Wikipedia

mprivat
  • 21,582
  • 4
  • 54
  • 64
0

Take a look at Area class. Method

public void intersect(Area rhs) {
    curves = new AreaOp.IntOp().calculate(this.curves, rhs.curves);
    invalidateBounds();
}

You can investigate the sources to understand how intersection point are calculated.

StanislavL
  • 56,971
  • 9
  • 68
  • 98