예제 #1
0
 public Coord2 AddPolar2(Polar2 polar)
 {
     ChangePolarFromCartesian(Polar.InCartesian() + polar.InCartesian());
     ChangeCartesianFromPolar(Polar);
     AttemptToRoundCartesian();
     return(this);
 }
예제 #2
0
 private void ChangeCartesianFromPolar(Polar2 polar) //Make public?
 {
     Cartesian.X = (float)(polar.Length * Math.Cos(polar.Angle));
     Cartesian.Y = (float)(polar.Length * Math.Sin(polar.Angle));
 }
예제 #3
0
 public static Vector2 CartesianFromPolar(Polar2 polar)
 {
     return(new Vector2((float)(polar.Length * Math.Cos(polar.Angle)), (float)(polar.Length * Math.Sin(polar.Angle))));
 }
예제 #4
0
 public Coord2(Vector2 cartesian)
 {
     Polar     = PolarFromCartesian(cartesian);
     Cartesian = cartesian;
 }
예제 #5
0
 public Coord2(Polar2 polar)
 {
     Polar     = polar;
     Cartesian = CartesianFromPolar(polar);
 }
예제 #6
0
 public Polar2(Polar2 polar)
 {
     Length = polar.Length;
     Angle  = polar.Angle;
 }