Struct Sphere
Represents a sphere in 3D space, which uses single-precision floating-point numbers for its coordinates.
Namespace: X10D.Drawing
Assembly: X10D.dll
Syntax
public struct Sphere : IEquatable<Sphere>, IComparable<Sphere>, IComparable
Constructors
| Improve this Doc View SourceSphere(Single, Single, Single, Single)
Initializes a new instance of the Sphere struct.
Declaration
public Sphere(float centerX, float centerY, float centerZ, float radius)
Parameters
Type | Name | Description |
---|---|---|
System.Single | centerX | The X coordinate of the center point. |
System.Single | centerY | The Y coordinate of the center point. |
System.Single | centerZ | The Z coordinate of the center point. |
System.Single | radius | The radius. |
Sphere(Vector3, Single)
Initializes a new instance of the Sphere struct.
Declaration
public Sphere(Vector3 center, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | center | The center point. |
System.Single | radius | The radius. |
Fields
| Improve this Doc View SourceSphere
The unit sphere. That is, a sphere with a radius of 1.
Declaration
public static readonly Sphere
Field Value
Type | Description |
---|---|
Sphere |
Sphere
The unit sphere. That is, a sphere with a radius of 1.
Declaration
public static readonly Sphere
Field Value
Type | Description |
---|---|
Sphere |
Sphere
The unit sphere. That is, a sphere with a radius of 1.
Declaration
public static readonly Sphere
Field Value
Type | Description |
---|---|
Sphere |
Empty
The empty sphere. That is, a sphere with a radius of zero.
Declaration
public static readonly Sphere Empty
Field Value
Type | Description |
---|---|
Sphere |
Unit
The unit sphere. That is, a sphere with a radius of 1.
Declaration
public static readonly Sphere Unit
Field Value
Type | Description |
---|---|
Sphere |
Properties
| Improve this Doc View SourceCenter
Gets the center-point of the sphere.
Declaration
public Vector3 Center { get; }
Property Value
Type | Description |
---|---|
Vector3 | The center point. |
Circumference
Gets the circumference of the sphere.
Declaration
public float Circumference { get; }
Property Value
Type | Description |
---|---|
System.Single | The circumference of the sphere, calculated as |
Diameter
Gets the diameter of the sphere.
Declaration
public float Diameter { get; }
Property Value
Type | Description |
---|---|
System.Single | The diameter. |
Radius
Gets the radius of the sphere.
Declaration
public float Radius { get; }
Property Value
Type | Description |
---|---|
System.Single | The radius. |
Volume
Gets the volume of this sphere.
Declaration
public float Volume { get; }
Property Value
Type | Description |
---|---|
System.Single | The volume. |
Methods
| Improve this Doc View SourceCompareTo(Nullable<Object>)
Compares this instance to another Sphere.
Declaration
public int CompareTo(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj | The other object. |
Returns
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
System.Int32 | A signed number indicating the relative values of this instance and
|
Remarks
Comparison only takes into consideration the Radius.
CompareTo(Sphere)
Compares this instance to another Sphere.
Declaration
public int CompareTo(Sphere other)
Parameters
Type | Name | Description |
---|---|---|
Sphere | other | The other sphere. |
Returns
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
System.Int32 | A signed number indicating the relative values of this instance and
|
Remarks
Comparison only takes into consideration the Radius.
Equals(Nullable<Object>)
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Sphere)
Returns a value indicating whether this instance and another instance are equal.
Declaration
public bool Equals(Sphere other)
Parameters
Type | Name | Description |
---|---|---|
Sphere | other | The instance with which to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if this instance and |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Operators
| Improve this Doc View SourceEquality(Sphere, Sphere)
Returns a value indicating whether two instances of Sphere are equal.
Declaration
public static bool operator ==(Sphere left, Sphere right)
Parameters
Type | Name | Description |
---|---|---|
Sphere | left | The first instance. |
Sphere | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
GreaterThan(Sphere, Sphere)
Returns a value indicating whether the radius of one circle is greater than to that of another.
Declaration
public static bool operator>(Sphere left, Sphere right)
Parameters
Type | Name | Description |
---|---|---|
Sphere | left | The first instance. |
Sphere | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Radius of |
GreaterThanOrEqual(Sphere, Sphere)
Returns a value indicating whether the radius of one circle is greater than or equal to that of another.
Declaration
public static bool operator >=(Sphere left, Sphere right)
Parameters
Type | Name | Description |
---|---|---|
Sphere | left | The first instance. |
Sphere | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Radius of |
Inequality(Sphere, Sphere)
Returns a value indicating whether two instances of Sphere are not equal.
Declaration
public static bool operator !=(Sphere left, Sphere right)
Parameters
Type | Name | Description |
---|---|---|
Sphere | left | The first instance. |
Sphere | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
LessThan(Sphere, Sphere)
Returns a value indicating whether the radius of one circle is less than that of another.
Declaration
public static bool operator <(Sphere left, Sphere right)
Parameters
Type | Name | Description |
---|---|---|
Sphere | left | The first instance. |
Sphere | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Radius of |
LessThanOrEqual(Sphere, Sphere)
Returns a value indicating whether the radius of one circle is less than or equal to that of another.
Declaration
public static bool operator <=(Sphere left, Sphere right)
Parameters
Type | Name | Description |
---|---|---|
Sphere | left | The first instance. |
Sphere | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Radius of |