public Segment2f(Vector2F p0, Vector2F p1) { //update_from_endpoints(p0, p1); Center = 0.5f * (p0 + p1); Direction = p1 - p0; Extent = 0.5f * Direction.Normalize(); }
public static float PlaneAngleSignedD(Vector2F vFrom, Vector2F vTo) { vFrom.Normalize(); vTo.Normalize(); float fSign = Math.Sign(vFrom.Cross(vTo)); float fAngle = fSign * Vector2F.AngleD(vFrom, vTo); return(fAngle); }
void update_from_endpoints(Vector2F p0, Vector2F p1) { Center = 0.5f * (p0 + p1); Direction = p1 - p0; Extent = 0.5f * Direction.Normalize(); }