public Coord2 AddPolar2(Polar2 polar) { ChangePolarFromCartesian(Polar.InCartesian() + polar.InCartesian()); ChangeCartesianFromPolar(Polar); AttemptToRoundCartesian(); return(this); }
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)); }
public static Vector2 CartesianFromPolar(Polar2 polar) { return(new Vector2((float)(polar.Length * Math.Cos(polar.Angle)), (float)(polar.Length * Math.Sin(polar.Angle)))); }
public Coord2(Vector2 cartesian) { Polar = PolarFromCartesian(cartesian); Cartesian = cartesian; }
public Coord2(Polar2 polar) { Polar = polar; Cartesian = CartesianFromPolar(polar); }
public Polar2(Polar2 polar) { Length = polar.Length; Angle = polar.Angle; }