/// <summary> /// Initializes a new instance of the <see cref="EllipticalCurve" /> class. /// </summary> /// <param name="a">Distance, a, from local origin to major vertex, M, which lies at the apex of the curve.</param> /// <param name="b">Distance, b, from local origin to minor vertex, M, which defines the asymptote that passes through the center.</param> /// <param name="center">The center.</param> /// <param name="rotation">The rotation offset from the horizontal x-axis.</param> /// <param name="tolerance">Tolerance to apply to the curve.</param> public HyperbolicCurve( double a, double b, CartesianCoordinate center, Angle rotation, double tolerance = DEFAULT_TOLERANCE) : base( center.OffsetCoordinate(a, rotation), distanceFromFocusToOrigin(a, b) - a, a, rotation, tolerance) { _focus = center.OffsetCoordinate(DistanceFromFocusToLocalOrigin, rotation); _focus.Tolerance = tolerance; }
/// <summary> /// Gets the directrix vertices. /// </summary> /// <returns>Tuple<CartesianCoordinate, CartesianCoordinate>.</returns> protected override Tuple <CartesianCoordinate, CartesianCoordinate> getVerticesDirectrix() { Angle rotation = new Angle(_rotation.Radians + Numbers.PiOver2); if (DistanceFromFocusToDirectrix == double.PositiveInfinity || DistanceFromFocusToDirectrix == double.NegativeInfinity) { return(new Tuple <CartesianCoordinate, CartesianCoordinate>( new CartesianCoordinate(DistanceFromFocusToDirectrix, 0), new CartesianCoordinate(DistanceFromFocusToDirectrix, 1))); } CartesianCoordinate directrixIntercept = _focus.OffsetCoordinate(DistanceFromFocusToDirectrix, _rotation); return(new Tuple <CartesianCoordinate, CartesianCoordinate>( directrixIntercept, directrixIntercept.OffsetCoordinate(1, rotation))); }