/// <summary> /// Returns true if the ray hits the supplied sphere within the /// supplied parameter interval and before the parameter value /// contained in the supplied hit. Note that a hit is only /// registered if the front or the backsurface is encountered /// within the interval. /// </summary> public bool Hits( Sphere3d sphere, double tmin, double tmax, ref RayHit3d hit) { return(HitsSphere(sphere.Center, sphere.Radius, tmin, tmax, ref hit)); }
/// <summary> /// Initializes a new instance of the <see cref="Sphere3d"/> class using values from another sphere instance. /// </summary> public Sphere3d(Sphere3d sphere) { Center = sphere.Center; Radius = sphere.Radius; }
public static bool ApproximateEquals(this Sphere3d a, Sphere3d b, double tolerance) => ApproximateEquals(a.Center, b.Center, tolerance) && ApproximateEquals(a.Radius, b.Radius, tolerance);
public static bool ApproximateEquals(this Sphere3d a, Sphere3d b) => ApproximateEquals(a, b, Constant <double> .PositiveTinyValue);
public bool Equals(Sphere3d other) => Center.Equals(other.Center) && Radius.Equals(other.Radius);