示例#1
0
 public Vector Rotate(UnitVector angle)
 {
     return(new Vector(
                X * angle.X - Y * angle.Y,
                X * angle.Y + Y * angle.X));
 }
示例#2
0
        private static Point CalcOrigin(double curvatureRate, double endLength, Circle endCircle, UnitVector originDirection)
        {
            var radiusV          = (-GetNormal(curvatureRate, endLength)).Rotate(originDirection) * endCircle.Radius;
            var startToEndVector = ((Vector)GetPoint(curvatureRate, endLength)).Rotate(originDirection);

            return(endCircle.Center + radiusV - startToEndVector);
        }
示例#3
0
 public Line(Point point, UnitVector direction)
 {
     A = -direction.Y;
     B = direction.X;
     P = A * point.X + B * point.Y;
 }
示例#4
0
        public Point Rotate(UnitVector angle, Point center)
        {
            var v = new Vector(center);

            return(Move(-v).Rotate(angle).Move(v));
        }
示例#5
0
 public Point Rotate(double angle, Point center)
 {
     return(Rotate(UnitVector.FromAngle(angle), center));
 }
示例#6
0
 /// <summary>
 /// Rotates point around (0; 0)
 /// </summary>
 public Point Rotate(UnitVector angle)
 {
     return(new Point(
                X * angle.X - Y * angle.Y,
                X * angle.Y + Y * angle.X));
 }