public complex(double rad, angle arg, string type) { if (type == "angle") { this.Re = rad * System.Math.Cos(arg); this.Im = rad * System.Math.Sin(arg); } }
public void InfixEquality() { var a = new angle(0d); var b = new angle(0d); Assert.True(a == b); }
public void FromVectors_PiOnTwo() { var actual = new angle(a, b); var expected = new angle(math.PI_DBL / 2d); Assert.AreEqual(expected.radians, actual.radians, tolerance); }
public void Inequality() { var a = new angle(0d); var b = new angle(1d); Assert.False(a.Equals(b)); }
public void FromDouble_Negative_SevenPiOnTwo() { var actual = new angle(-7d * math.PI_DBL / 2d); var expected = new angle(math.PI_DBL / 2d); Assert.AreEqual(expected.radians, actual.radians, tolerance); }
public void InfixInequality() { var a = new angle(0d); var b = new angle(1d); Assert.True(a != b); }
public void Equality() { var a = new angle(0d); var b = new angle(0d); Assert.True(a.Equals(b)); }
public void FromVectors_Zero() { var actual = new angle(a, a); var expected = new angle(0d); Assert.AreEqual(expected.radians, actual.radians, tolerance); }
public void FromSingleVector_Signed() { var actual = new angle(-b); var expected = new angle(-math.PI_DBL / 2d); Assert.AreEqual(expected.radians, actual.radians, tolerance); }
public void Radial_East() { var actual = new angle(0d).Radial(); var expected = xHat; Assert.AreEqual(expected.x, actual.x, tolerance); Assert.AreEqual(expected.y, actual.y, tolerance); }
public Elements(double a, double e, angle omega, angle theta, Direction direction) { this.a = a; this.e = e; this.omega = omega; this.theta = theta; this.direction = direction; }
public void ObjectEquality() { var a = new angle(0d); var b = new angle(1d); Assert.True(a.Equals(a)); Assert.False(a.Equals(b)); }
public void Perpendicular_West() { var actual = new angle(math.PI_DBL).Perpendicular(); var expected = -yHat; Assert.AreEqual(expected.x, actual.x, tolerance); Assert.AreEqual(expected.y, actual.y, tolerance); }
public void Perpendicular_South() { var actual = new angle(-math.PI_DBL / 2d).Perpendicular(); var expected = xHat; Assert.AreEqual(expected.x, actual.x, tolerance); Assert.AreEqual(expected.y, actual.y, tolerance); }
public void Perpendicular_East() { var actual = new angle(0d).Perpendicular(); var expected = yHat; Assert.AreEqual(expected.x, actual.x, tolerance); Assert.AreEqual(expected.y, actual.y, tolerance); }
public void Radial_West() { var actual = new angle(math.PI_DBL).Radial(); var expected = -xHat; Assert.AreEqual(expected.x, actual.x, tolerance); Assert.AreEqual(expected.y, actual.y, tolerance); }
public void Radial_South() { var actual = new angle(-math.PI_DBL / 2d).Radial(); var expected = -yHat; Assert.AreEqual(expected.x, actual.x, tolerance); Assert.AreEqual(expected.y, actual.y, tolerance); }
public void Hashing() { var a_1 = new angle(0d); var a_2 = new angle(0d); var b = new angle(1d); Assert.True(a_1.GetHashCode() == a_2.GetHashCode()); Assert.True(a_1.GetHashCode() != b.GetHashCode()); }
public void From_WorldVector_SouthNegative_WithAngle() { var theta = new angle(-math.PI_DBL / 2d); var expected = new coordinates(2d, theta); var actual = new coordinates(new double2(0d, -2d)); Assert.AreEqual(expected.r, actual.r, tolerance); Assert.AreEqual(expected.theta.radians, actual.theta.radians, tolerance); }
public void Formatting() { const double rad = 1d; var a = new angle(rad); Assert.AreEqual( $"{rad} radians", a.ToString() ); }
public void Formatting() { var a_r = 2d; var a_theta = new angle(3d); var a = new coordinates(a_r, a_theta.radians); Assert.AreEqual( $"coordinates(r: {a_r}, theta: {a_theta})", a.ToString() ); }
private void InputManagement() { if (Input.GetKey(KeyCode.D)) { direction = angle.right; } else if (Input.GetKeyUp(KeyCode.D)) { direction = angle.still; } if (Input.GetKey(KeyCode.A)) { direction = angle.left; } else if (Input.GetKeyUp(KeyCode.A)) { direction = angle.still; } }
private void RotateLeft() { if (Input.GetKey(KeyCode.A)) { if (laps > -3) { transform.localEulerAngles -= new Vector3(0, 0, 1000 * Time.deltaTime); } left.transform.position = checkerPosition.position; still.transform.position = Vector3.zero; right.transform.position = Vector3.zero; direction = angle.left; } else if (Input.GetKeyUp(KeyCode.A)) { still.transform.position = checkerPosition.position; right.transform.position = Vector3.zero; left.transform.position = Vector3.zero; direction = angle.still; } }
=> RotatePoint(x, y, angle, ox, oy);
Vector3 next = points[^ 1].GetPoint2D(angle, StepSize);
var(angle, q1) = _args;
=> SplitEllipticalArc1(x, y, rX, rY, angle, startAngle, sweepAngle, t);
SDL_RenderCopyEx(this, texture, IntPtr.Zero, dst, angle, IntPtr.Zero, flip);