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); }
public Vector3 ToVector3(PolarContext3 context) { var p2d = new PolarCircular(r, theta).ToVector2(); return(context.rotation * new Vector3(p2d.x, p2d.y, z) + context.polar); }
public Vector3 ToVector3() { var p2d = new PolarCircular(r, theta).ToVector2(); return(new Vector3(p2d.x, p2d.y, z)); }
public PolarCylindrical(PolarCircular p, float z) { this.r = p.r; this.z = z; this.theta = p.theta; }
public static PolarCircular NormalizeAngle(this PolarCircular coord) => new PolarCircular(coord.r, NormalizeAngle(coord.theta));
public static Vector2 ToVector2(this PolarCircular coord) { var rad = Mathf.Deg2Rad * coord.theta; return(new Vector2(Mathf.Cos(rad), Mathf.Sin(rad)) * coord.r); }