Struct Size3D
Universal structure that describes the size of an object in width and height in a two-dimensional space.
Implements
Inherited Members
Namespace: TheXDS.MCART.Types
Assembly: MCART.dll
Syntax
public struct Size3D : IFormattable, IEquatable<Size3D>, IEquatable<ISize3D>, ISize3D, ISize, IVector3D, IVector, IEquatable<IVector>, IEquatable<Vector2>, IEquatable<IVector3D>, IEquatable<Vector3>
Constructors
| Edit this page View SourceSize3D(double, double, double)
Universal structure that describes the size of an object in width and height in a two-dimensional space.
Declaration
public Size3D(double width, double height, double depth)
Parameters
| Type | Name | Description |
|---|---|---|
| double | width | Width value. |
| double | height | Height value. |
| double | depth | Depth value. |
Fields
| Edit this page View SourceNegativeInfinity
Gets a value that represents a negative infinite size. This field is read-only.
Declaration
public static readonly Size3D NegativeInfinity
Field Value
| Type | Description |
|---|---|
| Size3D |
Nothing
Gets a value that does not represent any size. This field is read-only.
Declaration
public static readonly Size3D Nothing
Field Value
| Type | Description |
|---|---|
| Size3D |
PositiveInfinity
Gets a value that represents an infinite size. This field is read-only.
Declaration
public static readonly Size3D PositiveInfinity
Field Value
| Type | Description |
|---|---|
| Size3D |
Zero
Gets a value that represents a null size. This field is read-only.
Declaration
public static readonly Size3D Zero
Field Value
| Type | Description |
|---|---|
| Size3D |
Properties
| Edit this page View SourceCubePerimeter
Calculates the perimeter represented by this size.
Declaration
public readonly double CubePerimeter { get; }
Property Value
| Type | Description |
|---|---|
| double |
CubeVolume
Calculates the square area represented by this size.
Declaration
public readonly double CubeVolume { get; }
Property Value
| Type | Description |
|---|---|
| double |
Depth
Gets the depth component of the size.
Declaration
public double Depth { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Height
Gets the height component of the size.
Declaration
public double Height { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| double |
IsReal
Gets a value indicating whether the size is valid in a real physical context.
Declaration
public readonly bool IsReal { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsValid
Gets a value indicating whether all size magnitudes of this instance are valid.
Declaration
public readonly bool IsValid { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsZero
Determines if this instance represents a null size.
Declaration
public readonly bool IsZero { get; }
Property Value
| Type | Description |
|---|---|
| bool | true if the size is null or false if the size does not contain volume. |
Width
Gets the width component of the size.
Declaration
public double Width { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Methods
| Edit this page View SourceEquals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override readonly bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | Object to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
| Edit this page View SourceEquals(ISize3D?)
Determines if this instance of ISize3D is equal to another.
Declaration
public readonly bool Equals(ISize3D? other)
Parameters
| Type | Name | Description |
|---|---|---|
| ISize3D | other | Instance of ISize3D to compare against. |
Returns
| Type | Description |
|---|---|
| bool | true if the sizes represented in both objects are equal, false otherwise. |
Equals(IVector3D?)
Determines if this instance of IVector3D is equal to another.
Declaration
public readonly bool Equals(IVector3D? other)
Parameters
| Type | Name | Description |
|---|---|---|
| IVector3D | other | Instance of IVector3D to compare against. |
Returns
| Type | Description |
|---|---|
| bool | true if the sizes represented in both objects are equal, false otherwise. |
Equals(Size3D)
Determines if this instance of Size is equal to another.
Declaration
public readonly bool Equals(Size3D other)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | other | Instance of Size to compare against. |
Returns
| Type | Description |
|---|---|
| bool | true if the sizes represented in both objects are equal, false otherwise. |
GetHashCode()
Returns the hash code generated for this instance.
Declaration
public override readonly int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code that represents this instance. |
Overrides
| Edit this page View SourceParse(string)
Creates a Size from a string.
Declaration
public static Size3D Parse(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | Value to create a Size from. |
Returns
| Type | Description |
|---|---|
| Size3D | The created Size. |
Exceptions
| Type | Condition |
|---|---|
| FormatException | Thrown if the conversion failed. |
ToString()
Converts this object to its string representation.
Declaration
public override readonly string ToString()
Returns
| Type | Description |
|---|---|
| string | A string representation of this object. |
Overrides
| Edit this page View SourceToString(string?)
Converts this object to its string representation.
Declaration
public readonly string ToString(string? format)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format | Format to use. |
Returns
| Type | Description |
|---|---|
| string | A string representation of this object. |
ToString(string?, IFormatProvider?)
Converts this object to its string representation.
Declaration
public readonly string ToString(string? format, IFormatProvider? formatProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format | Format to use. |
| IFormatProvider | formatProvider | Optional parameter. Format provider for the culture to use for formatting the string representation of this object. If omitted, CurrentCulture will be used. |
Returns
| Type | Description |
|---|---|
| string | A string representation of this object. |
TryParse(string?, out Size3D)
Attempts to create a Size from a string.
Declaration
public static bool TryParse(string? value, out Size3D size)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | Value to create a Size from. |
| Size3D | size | The created Size. |
Returns
| Type | Description |
|---|---|
| bool |
Operators
| Edit this page View Sourceoperator +(Size3D, double)
Performs an addition operation on the point.
Declaration
public static Size3D operator +(Size3D l, double r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| double | r | Addition operand. |
Returns
| Type | Description |
|---|---|
| Size3D | A new Size3D whose vectors are the sum of the
original vectors + |
operator +(Size3D, ISize3D)
Performs an addition operation on the points.
Declaration
public static Size3D operator +(Size3D l, ISize3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| ISize3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The sum of the vectors of the points. |
operator +(Size3D, IVector3D)
Performs an addition operation on the points.
Declaration
public static Size3D operator +(Size3D l, IVector3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| IVector3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The sum of the vectors of the points. |
operator +(Size3D, Size3D)
Performs an addition operation on the points.
Declaration
public static Size3D operator +(Size3D l, Size3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| Size3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The sum of the vectors of the points. |
operator --(Size3D)
Decrements by 1 the vectors of the point.
Declaration
public static Size3D operator --(Size3D p)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | p | Point to decrement. |
Returns
| Type | Description |
|---|---|
| Size3D | A point with its vectors decremented by 1. |
operator /(Size3D, double)
Performs a division operation on the point.
Declaration
public static Size3D operator /(Size3D l, double r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| double | r | Division operand. |
Returns
| Type | Description |
|---|---|
| Size3D | A new Size3D whose vectors are the division of
the original vectors / |
operator /(Size3D, ISize3D)
Performs a division operation on the points.
Declaration
public static Size3D operator /(Size3D l, ISize3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| ISize3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The division of the vectors of the points. |
operator /(Size3D, IVector3D)
Performs a division operation on the points.
Declaration
public static Size3D operator /(Size3D l, IVector3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| IVector3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The division of the vectors of the points. |
operator /(Size3D, Size3D)
Performs a division operation on the points.
Declaration
public static Size3D operator /(Size3D l, Size3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| Size3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The division of the vectors of the points. |
operator ==(Size3D, ISize3D)
Compares equality between two instances of Size3D.
Declaration
public static bool operator ==(Size3D size1, ISize3D size2)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | size1 | First element to compare. |
| ISize3D | size2 | Second element to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if the sizes represented in both objects are equal, false otherwise. |
operator ==(Size3D, IVector3D)
Compares equality between two instances of Size3D.
Declaration
public static bool operator ==(Size3D size1, IVector3D size2)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | size1 | First element to compare. |
| IVector3D | size2 | Second element to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if the sizes represented in both objects are equal, false otherwise. |
operator ==(Size3D, Size3D)
Compares equality between two instances of Size3D.
Declaration
public static bool operator ==(Size3D size1, Size3D size2)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | size1 | First element to compare. |
| Size3D | size2 | Second element to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if the sizes represented in both objects are equal, false otherwise. |
implicit operator Size3D(Vector3)
Declaration
public static implicit operator Size3D(Vector3 p)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | p | Vector3 value to be converted. |
Returns
| Type | Description |
|---|---|
| Size3D |
implicit operator Vector3(Size3D)
Declaration
public static implicit operator Vector3(Size3D p)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | p | Size3D value to be converted. |
Returns
| Type | Description |
|---|---|
| Vector3 |
operator ++(Size3D)
Increments by 1 the vectors of the point.
Declaration
public static Size3D operator ++(Size3D p)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | p | Point to increment. |
Returns
| Type | Description |
|---|---|
| Size3D | A point with its vectors incremented by 1. |
operator !=(Size3D, ISize3D)
Compares inequality between two instances of Size3D.
Declaration
public static bool operator !=(Size3D size1, ISize3D size2)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | size1 | First element to compare. |
| ISize3D | size2 | Second element to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if the sizes represented in both objects are different, false otherwise. |
operator !=(Size3D, IVector3D)
Compares inequality between two instances of Size3D.
Declaration
public static bool operator !=(Size3D size1, IVector3D size2)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | size1 | First element to compare. |
| IVector3D | size2 | Second element to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if the sizes represented in both objects are different, false otherwise. |
operator !=(Size3D, Size3D)
Compares inequality between two instances of Size3D.
Declaration
public static bool operator !=(Size3D size1, Size3D size2)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | size1 | First element to compare. |
| Size3D | size2 | Second element to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if the sizes represented in both objects are different, false otherwise. |
operator %(Size3D, double)
Performs a remainder operation on the point.
Declaration
public static Size3D operator %(Size3D l, double r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| double | r | Remainder operand. |
Returns
| Type | Description |
|---|---|
| Size3D | A new Size3D whose vectors are the remainder of the
original vectors % |
operator %(Size3D, ISize3D)
Performs a remainder operation on the points.
Declaration
public static Size3D operator %(Size3D l, ISize3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| ISize3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The remainder of the vectors of the points. |
operator %(Size3D, IVector3D)
Performs a remainder operation on the points.
Declaration
public static Size3D operator %(Size3D l, IVector3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| IVector3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | A new Size3D whose vectors are the remainder of the
original vectors % |
operator %(Size3D, Size3D)
Performs a remainder operation on the points.
Declaration
public static Size3D operator %(Size3D l, Size3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| Size3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The remainder of the vectors of the points. |
operator *(Size3D, double)
Performs a multiplication operation on the point.
Declaration
public static Size3D operator *(Size3D l, double r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| double | r | Multiplication operand. |
Returns
| Type | Description |
|---|---|
| Size3D | A new Size3D whose vectors are the multiplication
of the original vectors * |
operator *(Size3D, ISize3D)
Performs a multiplication operation on the points.
Declaration
public static Size3D operator *(Size3D l, ISize3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| ISize3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The multiplication of the vectors of the points. |
operator *(Size3D, IVector3D)
Performs a multiplication operation on the points.
Declaration
public static Size3D operator *(Size3D l, IVector3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| IVector3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The multiplication of the vectors of the points. |
operator *(Size3D, Size3D)
Performs a multiplication operation on the points.
Declaration
public static Size3D operator *(Size3D l, Size3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| Size3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The multiplication of the vectors of the points. |
operator -(Size3D, double)
Performs a subtraction operation on the point.
Declaration
public static Size3D operator -(Size3D l, double r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| double | r | Subtraction operand. |
Returns
| Type | Description |
|---|---|
| Size3D | A new Size3D whose vectors are the difference of the
original vectors - |
operator -(Size3D, ISize3D)
Performs a subtraction operation on the points.
Declaration
public static Size3D operator -(Size3D l, ISize3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| ISize3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The difference of the vectors of the points. |
operator -(Size3D, IVector3D)
Performs a subtraction operation on the points.
Declaration
public static Size3D operator -(Size3D l, IVector3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| IVector3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The difference of the vectors of the points. |
operator -(Size3D, Size3D)
Performs a subtraction operation on the points.
Declaration
public static Size3D operator -(Size3D l, Size3D r)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | l | Point 1. |
| Size3D | r | Point 2. |
Returns
| Type | Description |
|---|---|
| Size3D | The difference of the vectors of the points. |
operator -(Size3D)
Inverts the sign of the vectors of the point.
Declaration
public static Size3D operator -(Size3D p)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | p | Point to operate. |
Returns
| Type | Description |
|---|---|
| Size3D | A point with the sign of its vectors inverted. |
operator +(Size3D)
Converts to positive the vectors of the point.
Declaration
public static Size3D operator +(Size3D p)
Parameters
| Type | Name | Description |
|---|---|---|
| Size3D | p | Point to operate. |
Returns
| Type | Description |
|---|---|
| Size3D | A point with its vectors positive. |