예제 #1
0
        public static Vector2 ToVector2(this PolarCircular coord, PolarContext2 context)
        {
            var theta2 = context.isClockwise ? -coord.theta : coord.theta;
            var rad    = Mathf.Deg2Rad * (theta2 + context.rotation);

            return(new Vector2(Mathf.Cos(rad), Mathf.Sin(rad)) * coord.r + context.polar);
        }
예제 #2
0
        public Vector3 ToVector3(PolarContext3 context)
        {
            var p2d = new PolarCircular(r, theta).ToVector2();

            return(context.rotation * new Vector3(p2d.x, p2d.y, z) + context.polar);
        }
예제 #3
0
        public Vector3 ToVector3()
        {
            var p2d = new PolarCircular(r, theta).ToVector2();

            return(new Vector3(p2d.x, p2d.y, z));
        }
예제 #4
0
 public PolarCylindrical(PolarCircular p, float z)
 {
     this.r     = p.r;
     this.z     = z;
     this.theta = p.theta;
 }
예제 #5
0
 public static PolarCircular NormalizeAngle(this PolarCircular coord) => new PolarCircular(coord.r, NormalizeAngle(coord.theta));
예제 #6
0
        public static Vector2 ToVector2(this PolarCircular coord)
        {
            var rad = Mathf.Deg2Rad * coord.theta;

            return(new Vector2(Mathf.Cos(rad), Mathf.Sin(rad)) * coord.r);
        }