Struct Rotation
Represents an angular rotation.
Implements
Inherited Members
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public readonly struct Rotation : IEquatable<Rotation>
Constructors
| Edit this page View SourceRotation(float)
Initializes a new instance of the Rotation class using the provided values.
Declaration
public Rotation(float degrees)
Parameters
Type | Name | Description |
---|---|---|
float | degrees | The rotation in degrees. |
Properties
| Edit this page View SourceDegrees
Gets the angle in degrees.
Declaration
public float Degrees { get; }
Property Value
Type | Description |
---|---|
float |
IsRotated
Gets a bool indicating if the rotation is > 0.
Declaration
public bool IsRotated { get; }
Property Value
Type | Description |
---|---|
bool |
Radians
Gets the angle in radians.
Declaration
public float Radians { get; }
Property Value
Type | Description |
---|---|
float |
Methods
| Edit this page View SourceEquals(Rotation)
Declaration
public bool Equals(Rotation other)
Parameters
Type | Name | Description |
---|---|---|
Rotation | other | The rotation to test. |
Returns
Type | Description |
---|---|
bool |
|
Equals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to test. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
| Edit this page View SourceFromDegrees(float)
Creates a new Rotation out of the specified degree-angle.
Declaration
public static Rotation FromDegrees(float degrees)
Parameters
Type | Name | Description |
---|---|---|
float | degrees | The angle in degrees. |
Returns
Type | Description |
---|---|
Rotation | The new rotation. |
FromRadians(float)
Creates a new Rotation out of the specified radian-angle.
Declaration
public static Rotation FromRadians(float radians)
Parameters
Type | Name | Description |
---|---|---|
float | radians | The angle in radians. |
Returns
Type | Description |
---|---|
Rotation | The new rotation. |
GetHashCode()
Returns a hash code for this Rotation.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | An integer value that specifies the hash code for this Rotation. |
Overrides
Operators
| Edit this page View Sourceoperator +(in Rotation, float)
Declaration
public static Rotation operator +(in Rotation rotation, float value)
Parameters
Type | Name | Description |
---|---|---|
Rotation | rotation | The Rotation. |
float | value | The value to add. |
Returns
Type | Description |
---|---|
Rotation | A new Rotation representing the addition of the Rotation and the provided value. |
operator /(in Rotation, float)
Declaration
public static Rotation operator /(in Rotation rotation, float value)
Parameters
Type | Name | Description |
---|---|---|
Rotation | rotation | The Rotation. |
float | value | The value to device with. |
Returns
Type | Description |
---|---|
Rotation | A new Rotation representing the division of the Rotation and the provided value. |
operator ==(in Rotation, in Rotation)
Returns a value that indicates whether two specified Rotation are equal.
Declaration
public static bool operator ==(in Rotation rotation1, in Rotation rotation2)
Parameters
Type | Name | Description |
---|---|---|
Rotation | rotation1 | The first Rotation to compare. |
Rotation | rotation2 | The second Rotation to compare. |
Returns
Type | Description |
---|---|
bool |
|
implicit operator float(in Rotation)
Converts Rotation to a float representing the rotation in degrees.
Declaration
public static implicit operator float(in Rotation rotation)
Parameters
Type | Name | Description |
---|---|---|
Rotation | rotation | The rotatio to convert. |
Returns
Type | Description |
---|---|
float |
implicit operator Rotation(float)
Converts a float to a Rotation.
Declaration
public static implicit operator Rotation(float rotation)
Parameters
Type | Name | Description |
---|---|---|
float | rotation | The rotation in degrees to convert. |
Returns
Type | Description |
---|---|
Rotation |
operator !=(in Rotation, in Rotation)
Returns a value that indicates whether two specified Rotation are equal.
Declaration
public static bool operator !=(in Rotation rotation1, in Rotation rotation2)
Parameters
Type | Name | Description |
---|---|---|
Rotation | rotation1 | The first Rotation to compare. |
Rotation | rotation2 | The second Rotation to compare. |
Returns
Type | Description |
---|---|
bool |
|
operator *(in Rotation, float)
Declaration
public static Rotation operator *(in Rotation rotation, float value)
Parameters
Type | Name | Description |
---|---|---|
Rotation | rotation | The Rotation. |
float | value | The value to multiply with. |
Returns
Type | Description |
---|---|
Rotation | A new Rotation representing the multiplication of the Rotation and the provided value. |
operator -(in Rotation, float)
Declaration
public static Rotation operator -(in Rotation rotation, float value)
Parameters
Type | Name | Description |
---|---|---|
Rotation | rotation | The Rotation. |
float | value | The value to substract. |
Returns
Type | Description |
---|---|
Rotation | A new Rotation representing the subtraction of the Rotation and the provided value. |