Table of Contents

Struct Circle

Namespace
SimulationFramework
Assembly
SimulationFramework.dll

A floating point 2-dimensional circle.

public struct Circle : IEquatable<Circle>
Implements
Inherited Members

Constructors

Circle(Vector2, float, Alignment)

Creates a new circle given its position and radius.

public Circle(Vector2 position, float radius, Alignment alignment = Alignment.Center)

Parameters

position Vector2

The position of the circle.

radius float

The radius of the circle.

alignment Alignment

The location of position on the circle's bounding box.

Circle(float, float, float, Alignment)

Creates a new circle given its position and radius.

public Circle(float x, float y, float radius, Alignment alignment = Alignment.Center)

Parameters

x float

The x position of the circle.

y float

The y position of the circle.

radius float

The radius of the circle.

alignment Alignment

The location of x and y on the circle's bounding box.

Fields

Position

The position of the circle.

public Vector2 Position

Field Value

Vector2

Radius

The radius of the circle.

public float Radius

Field Value

float

Unit

The unit circle at (0, 0).

public static readonly Circle Unit

Field Value

Circle

Methods

ContainsPoint(Vector2)

Determines if a point lies within this circle.

public bool ContainsPoint(Vector2 point)

Parameters

point Vector2

The point to check the circle for.

Returns

bool

true if this circle contains the provided point; otherwise false

Distance(Circle)

Computes the distance from this circle to another.

public float Distance(Circle other)

Parameters

other Circle

The circle to compute the distance to.

Returns

float

The computed distance, or 0 if the point lies within this circle.

Distance(Vector2)

Computes the distance from this circle to a given point.

public float Distance(Vector2 point)

Parameters

point Vector2

The point to compute the distance to.

Returns

float

The computed distance, or 0 if the point lies within this circle.

Equals(Circle)

Indicates if this circle is equal to another.

public bool Equals(Circle other)

Parameters

other Circle

The circle to compare with this circle.

Returns

bool

true if this circle equals other, otherwise false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetBounds()

Computes the bounding rectangle of this circle.

public Rectangle GetBounds()

Returns

Rectangle

The bounds of this circle.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

GetPoint(float)

Computes a point on this circle given an angle.

public Vector2 GetPoint(float angle)

Parameters

angle float

Returns

Vector2

The computed point.

Intersects(Circle)

Determines if two circles are intersecting.

public bool Intersects(Circle other)

Parameters

other Circle

The circle to check for an intersection with.

Returns

bool

true if the circles are intersecting; otherwise false

SignedDistance(Circle)

Computes the signed distance from this circle to another.

public float SignedDistance(Circle other)

Parameters

other Circle

The circle to compute the distance to.

Returns

float

The computed distance.

SignedDistance(Vector2)

Computes the signed distance from this circle to a given point.

public float SignedDistance(Vector2 point)

Parameters

point Vector2

The point to compute the distance to.

Returns

float

The computed distance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(Circle, Circle)

public static bool operator ==(Circle left, Circle right)

Parameters

left Circle
right Circle

Returns

bool

operator !=(Circle, Circle)

public static bool operator !=(Circle left, Circle right)

Parameters

left Circle
right Circle

Returns

bool