Show / Hide Table of Contents

Struct Rotation

Represents an angular rotation.

Implements
IEquatable<Rotation>
Inherited Members
ValueType.ToString()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public readonly struct Rotation : IEquatable<Rotation>

Constructors

| Edit this page View Source

Rotation(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 Source

Degrees

Gets the angle in degrees.

Declaration
public float Degrees { get; }
Property Value
Type Description
float
| Edit this page View Source

IsRotated

Gets a bool indicating if the rotation is > 0.

Declaration
public bool IsRotated { get; }
Property Value
Type Description
bool
| Edit this page View Source

Radians

Gets the angle in radians.

Declaration
public float Radians { get; }
Property Value
Type Description
float

Methods

| Edit this page View Source

Equals(Rotation)

Tests whether the specified Rotation is equivalent to this Rotation.

Declaration
public bool Equals(Rotation other)
Parameters
Type Name Description
Rotation other

The rotation to test.

Returns
Type Description
bool

true if other is equivalent to this Rotation; otherwise, false.

| Edit this page View Source

Equals(object?)

Tests whether the specified object is a Rotation and is equivalent to this Rotation.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj

The object to test.

Returns
Type Description
bool

true if obj is a Rotation equivalent to this Rotation; otherwise, false.

Overrides
ValueType.Equals(object)
| Edit this page View Source

FromDegrees(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.

| Edit this page View Source

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.

| Edit this page View Source

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
ValueType.GetHashCode()

Operators

| Edit this page View Source

operator +(in Rotation, float)

Returns a new Rotation representing the addition of the Rotation and the provided value.

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.

| Edit this page View Source

operator /(in Rotation, float)

Returns a new Rotation representing the division of the Rotation and the provided value.

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.

| Edit this page View Source

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

true if rotation1 and rotation2 are equal; otherwise, false.

| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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

true if rotation1 and rotation2 are not equal; otherwise, false.

| Edit this page View Source

operator *(in Rotation, float)

Returns a new Rotation representing the multiplication of the Rotation and the provided value.

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.

| Edit this page View Source

operator -(in Rotation, float)

Returns a new Rotation representing the subtraction of the Rotation and the provided value.

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.

Implements

IEquatable<T>
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX