Exemplo n.º 1
0
 public static PointD ToCartesian(RadialPointD location, PointD origin)
 {
     PointD p = new PointD();
     p.X = location.R * Math.Cos(location.Theta);
     p.Y = location.R * Math.Sin(location.Theta);
     return p + origin;
 }
Exemplo n.º 2
0
 public static RadialPointD ToPolar(PointD location, PointD origin)
 {
     PointD v = location - origin;
     RadialPointD n = new RadialPointD();
     n.m_r = v.Magnitude();
     n.m_theta = Math.Atan2(v.Y, v.X);
     return n;
 }