예제 #1
0
 public Segment2f(Vector2F p0, Vector2F p1)
 {
     //update_from_endpoints(p0, p1);
     Center    = 0.5f * (p0 + p1);
     Direction = p1 - p0;
     Extent    = 0.5f * Direction.Normalize();
 }
예제 #2
0
        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);
        }
예제 #3
0
 void update_from_endpoints(Vector2F p0, Vector2F p1)
 {
     Center    = 0.5f * (p0 + p1);
     Direction = p1 - p0;
     Extent    = 0.5f * Direction.Normalize();
 }