Points Polar in c#

Hi is there api for point Polar in c#
If not ! We can create point by vectors
IMG_20230320_100435_237

  // <Custom additional code> 
  Point3d polar (Point3d bas, double ang, double offset){
    var t = Transform.Translation(Vector3d.XAxis);
    var mp = bas;
    mp.Transform(t);
    var r = Transform.Rotation(RhinoMath.ToRadians(ang), bas);
    mp.Transform(r);
    Vector3d v = new Vector3d(mp - bas);
    v.Unitize();
    t = Transform.Translation(v * offset);
    bas.Transform(t);
    return bas;

    }

Use sine/cosine.

  Point3d PolarPT(Plane P, double xy, double z, double d){
    double w = Math.Cos(z);
    Point3d p = new Point3d(d * w * Math.Cos(xy), d * w * Math.Sin(xy), d * Math.Sin(z));
    p.Transform(Transform.PlaneToPlane(Plane.WorldXY, P));
    return p;
  }
1 Like