Struct Circle
Represents a circle that is composed of a 32-bit signed integer center point and radius.
Namespace: X10D.Drawing
Assembly: X10D.dll
Syntax
public struct Circle : IEquatable<Circle>, IComparable<Circle>, IComparable
Constructors
| Improve this Doc View SourceCircle(Point, Int32)
Initializes a new instance of the Circle struct.
Declaration
public Circle(Point center, int radius)
Parameters
Type | Name | Description |
---|---|---|
Point | center | The center point of the circle. |
System.Int32 | radius | The radius of the circle. |
Circle(Int32, Int32, Int32)
Initializes a new instance of the Circle struct.
Declaration
public Circle(int centerX, int centerY, int radius)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | centerX | The X coordinate of the center point. |
System.Int32 | centerY | The Y coordinate of the center point. |
System.Int32 | radius | The radius of the circle. |
Fields
| Improve this Doc View SourceCircle
The unit circle. That is, a circle whose center point is (0, 0) and whose radius is 1.
Declaration
public static readonly Circle
Field Value
Type | Description |
---|---|
Circle |
Circle
The unit circle. That is, a circle whose center point is (0, 0) and whose radius is 1.
Declaration
public static readonly Circle
Field Value
Type | Description |
---|---|
Circle |
Empty
The empty circle. That is, a circle whose center point is (0, 0) and whose radius is 0.
Declaration
public static readonly Circle Empty
Field Value
Type | Description |
---|---|
Circle |
Unit
The unit circle. That is, a circle whose center point is (0, 0) and whose radius is 1.
Declaration
public static readonly Circle Unit
Field Value
Type | Description |
---|---|
Circle |
Properties
| Improve this Doc View SourceArea
Gets the area of the circle.
Declaration
public float Area { get; }
Property Value
Type | Description |
---|---|
System.Single | The area of the circle, calculated as |
Center
Gets the center point of the circle.
Declaration
public Point Center { get; }
Property Value
Type | Description |
---|---|
Point | The center point. |
Circumference
Gets the circumference of the circle.
Declaration
public float Circumference { get; }
Property Value
Type | Description |
---|---|
System.Single | The circumference of the circle, calculated as |
Diameter
Gets the diameter of the circle.
Declaration
public int Diameter { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The diameter. This is always twice the Radius. |
Radius
Gets the radius of the circle.
Declaration
public int Radius { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The radius. |
Methods
| Improve this Doc View SourceCompareTo(Nullable<Object>)
Compares this instance to another Circle.
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(Circle)
Compares this instance to another Circle.
Declaration
public int CompareTo(Circle other)
Parameters
Type | Name | Description |
---|---|---|
Circle | other | The other circle. |
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(Circle)
Returns a value indicating whether this instance and another instance are equal.
Declaration
public bool Equals(Circle other)
Parameters
Type | Name | Description |
---|---|---|
Circle | other | The instance with which to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if this instance and |
FromCircleF(CircleF)
Declaration
public static Circle FromCircleF(CircleF circle)
Parameters
Type | Name | Description |
---|---|---|
CircleF | circle | The circle to convert. |
Returns
Type | Description |
---|---|
Circle | The converted circle. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Operators
| Improve this Doc View SourceEquality(Circle, Circle)
Returns a value indicating whether two instances of Circle are equal.
Declaration
public static bool operator ==(Circle left, Circle right)
Parameters
Type | Name | Description |
---|---|---|
Circle | left | The first instance. |
Circle | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Explicit(CircleF to Circle)
Declaration
public static explicit operator Circle(CircleF circle)
Parameters
Type | Name | Description |
---|---|---|
CircleF | circle | The circle to convert. |
Returns
Type | Description |
---|---|
Circle | The converted circle. |
GreaterThan(Circle, Circle)
Returns a value indicating whether the radius of one circle is greater than to that of another.
Declaration
public static bool operator>(Circle left, Circle right)
Parameters
Type | Name | Description |
---|---|---|
Circle | left | The first instance. |
Circle | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Radius of |
GreaterThanOrEqual(Circle, Circle)
Returns a value indicating whether the radius of one circle is greater than or equal to that of another.
Declaration
public static bool operator >=(Circle left, Circle right)
Parameters
Type | Name | Description |
---|---|---|
Circle | left | The first instance. |
Circle | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Radius of |
Inequality(Circle, Circle)
Returns a value indicating whether two instances of Circle are not equal.
Declaration
public static bool operator !=(Circle left, Circle right)
Parameters
Type | Name | Description |
---|---|---|
Circle | left | The first instance. |
Circle | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
LessThan(Circle, Circle)
Returns a value indicating whether the radius of one circle is less than that of another.
Declaration
public static bool operator <(Circle left, Circle right)
Parameters
Type | Name | Description |
---|---|---|
Circle | left | The first instance. |
Circle | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Radius of |
LessThanOrEqual(Circle, Circle)
Returns a value indicating whether the radius of one circle is less than or equal to that of another.
Declaration
public static bool operator <=(Circle left, Circle right)
Parameters
Type | Name | Description |
---|---|---|
Circle | left | The first instance. |
Circle | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Radius of |