Class IntrSegment2Circle2f
- java.lang.Object
-
- WildMagic.LibFoundation.Intersection.IntrSegment2Circle2f
-
- All Implemented Interfaces:
java.io.Serializable
public class IntrSegment2Circle2f extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description IntrSegment2Circle2f()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static int
Find(Vector2f kP, Vector2f kD, Vector2f kC, float fR, float[] afT)
Intersection of a the line P+t*D and the circle |X-C| = R.static int
FindIntersection(Segment2f kSegment, Circle2f kCircle, Vector2f[] akPoint)
The value is 0 if the objects do not intersect.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
FindIntersection
public static int FindIntersection(Segment2f kSegment, Circle2f kCircle, Vector2f[] akPoint)
The value is 0 if the objects do not intersect. Otherwise, the quantity is 1 or 2 and is the number of valid points in The points of intersection are returned in the akPoint array which must have length 2.- Parameters:
kSegment
- DOCUMENT ME!kCircle
- DOCUMENT ME!akPoint
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
Find
private static int Find(Vector2f kP, Vector2f kD, Vector2f kC, float fR, float[] afT)
Intersection of a the line P+t*D and the circle |X-C| = R. The t value is a root to the quadratic equation: 0 = |t*D+P-C|^2 - R^2 = |D|^2*t^2 + 2*D.Dot(P-C)*t + |P-C|^2-R^2 = a2*t^2 + 2*a1*t + a0 If two roots are returned, the order is T[0] < T[1]. Hopefully the application will be kind and provide line directions D that are not so small that a2 is nearly zero and potentially creates numerical problems. The t parameter for the points of intersection are returned in the afT array which must have length 2.- Parameters:
kP
- DOCUMENT ME!kD
- DOCUMENT ME!kC
- DOCUMENT ME!fR
- DOCUMENT ME!afT
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
-