public CartesianPoint TransformPointGlobalCartesianToLocalCartesian(CartesianPoint cartesianGlobalPoint) { Vector2 local = RotationMatrixGlobalToLocal * Vector2.CreateFromArray(cartesianGlobalPoint.Coordinates); local.AddIntoThis(localCoordinatesOfGlobalOrigin); return(new CartesianPoint(local[0], local[1])); }
public PolarPoint2D TransformPointGlobalCartesianToLocalPolar(CartesianPoint cartesianGlobalPoint) { Vector2 local = RotationMatrixGlobalToLocal * Vector2.Create(cartesianGlobalPoint.X, cartesianGlobalPoint.Y); local.AddIntoThis(localCoordinatesOfGlobalOrigin); double x1 = local[0]; double x2 = local[1]; double r = Math.Sqrt(x1 * x1 + x2 * x2); double theta = Math.Atan2(x2, x1); return(new PolarPoint2D(r, theta)); }