Struct FixedBoundCircle
- Namespace
- FixedMathSharp.Geometry
- Assembly
- FixedMathSharp.dll
Represents a normalized two-dimensional circular bound.
[MemoryPackable(GenerateType.Object)]
public struct FixedBoundCircle : IEquatable<FixedBoundCircle>, IMemoryPackable<FixedBoundCircle>, IMemoryPackFormatterRegister
- Implements
-
IMemoryPackable<FixedBoundCircle>IMemoryPackFormatterRegister
- Inherited Members
Remarks
Radius inputs are normalized by absolute value so a public circle cannot retain a negative radius through construction, assignment, or state load.
Constructors
FixedBoundCircle(BoundingCircleState)
Initializes a new instance from serialized or caller-provided state.
[JsonConstructor]
public FixedBoundCircle(FixedBoundCircle.BoundingCircleState state)
Parameters
FixedBoundCircle(Vector2d, Fixed64)
Initializes a new instance from a center point and radius.
public FixedBoundCircle(Vector2d center, Fixed64 radius)
Parameters
Properties
Bounds
The normalized axis-aligned representable-domain intersection that contains every representable point of the circle.
[JsonIgnore]
[MemoryPackIgnore]
public FixedBoundArea Bounds { get; }
Property Value
Center
The center point of the circle.
[JsonIgnore]
[MemoryPackIgnore]
public Vector2d Center { readonly get; set; }
Property Value
Radius
The non-negative radius of the circle. Assigned values are normalized by absolute value.
[JsonIgnore]
[MemoryPackIgnore]
public Fixed64 Radius { get; set; }
Property Value
State
Gets the current normalized state of the circle.
[JsonInclude]
[MemoryPackInclude]
public FixedBoundCircle.BoundingCircleState State { get; }
Property Value
Methods
ClampPoint(Vector2d)
Clamps a point to this circle, returning the point unchanged when it is already inside.
public Vector2d ClampPoint(Vector2d point)
Parameters
pointVector2d
Returns
Contains(FixedBoundCircle)
Classifies another circle against this circle using boundary-inclusive overlap.
public FixedEnclosureType Contains(FixedBoundCircle circle)
Parameters
circleFixedBoundCircle
Returns
Contains(Vector2d)
Determines whether the point is inside this circle, including the boundary.
public bool Contains(Vector2d point)
Parameters
pointVector2d
Returns
ContainsStrict(Vector2d)
Returns whether the point lies strictly inside this circle.
public bool ContainsStrict(Vector2d point)
Parameters
pointVector2d
Returns
Remarks
Boundary points and every point tested against a zero-radius circle return false.
Deconstruct(out Vector2d, out Fixed64)
Deconstructs the circle into center and normalized radius.
public void Deconstruct(out Vector2d center, out Fixed64 radius)
Parameters
Equals(FixedBoundCircle)
public bool Equals(FixedBoundCircle other)
Parameters
otherFixedBoundCircle
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Intersects(FixedBoundArea)
Determines whether an area intersects this circle, including boundary-only contact.
public bool Intersects(FixedBoundArea area)
Parameters
areaFixedBoundArea
Returns
Intersects(FixedBoundCircle)
Determines whether another circle intersects this circle, including boundary-only contact.
public bool Intersects(FixedBoundCircle circle)
Parameters
circleFixedBoundCircle
Returns
IntersectsStrict(FixedBoundArea)
Determines whether an area overlaps this circle with positive area.
public bool IntersectsStrict(FixedBoundArea area)
Parameters
areaFixedBoundArea
Returns
IntersectsStrict(FixedBoundCircle)
Determines whether another circle overlaps this circle with positive area.
public bool IntersectsStrict(FixedBoundCircle circle)
Parameters
circleFixedBoundCircle
Returns
ProjectPoint(Vector2d)
Projects a point onto the circle boundary. The center is returned when the direction is degenerate.
public Vector2d ProjectPoint(Vector2d point)
Parameters
pointVector2d
Returns
Operators
operator ==(FixedBoundCircle, FixedBoundCircle)
Determines whether two circles have the same normalized state.
public static bool operator ==(FixedBoundCircle left, FixedBoundCircle right)
Parameters
leftFixedBoundCirclerightFixedBoundCircle
Returns
operator !=(FixedBoundCircle, FixedBoundCircle)
Determines whether two circles have different normalized state.
public static bool operator !=(FixedBoundCircle left, FixedBoundCircle right)
Parameters
leftFixedBoundCirclerightFixedBoundCircle