public Acceleration(SpeedRate x, SpeedRate y, SpeedRate z) { var xyx = Math.Sqrt(Math.Pow(x.TotalMetersPerSecondPerSecond, 2) + Math.Pow(y.TotalMetersPerSecondPerSecond, 2) + Math.Pow(z.TotalMetersPerSecondPerSecond, 2)); var xy = Math.Sqrt(Math.Pow(x.TotalMetersPerSecondPerSecond, 2) + Math.Pow(y.TotalMetersPerSecondPerSecond, 2)); SpeedRate = xyx.MetersPerSecondPerSecond(); var angleH = Math.Atan2(y.TotalMetersPerSecondPerSecond, x.TotalMetersPerSecondPerSecond); var angleV = Math.Atan2(z.TotalMetersPerSecondPerSecond, xy); Angle = new Angle2(angleH, angleV); }
public int CompareTo(SpeedRate other) => TotalMetersPerSecondPerSecond.CompareTo(other.TotalMetersPerSecondPerSecond);
public bool Equals(SpeedRate other) => Math.Abs(TotalMetersPerSecondPerSecond - other.TotalMetersPerSecondPerSecond) < UnitConstants.EqualityComparisonEpsilon;
internal static Acceleration AtAngle(this SpeedRate speedRate, Angle2 angle) { return(new Acceleration(speedRate, angle)); }
public Acceleration(SpeedRate speedRate, Angle angleH, Angle angleV) : this(speedRate, new Angle2(angleH, angleV)) { }
public Acceleration(SpeedRate speedrate, Angle2 angle) { SpeedRate = speedrate; Angle = angle; }