Click or drag to resize

UtilIntersectCircleSphere(Vector3, Vector3, Double, Vector3, Double) Method

Calculate the intersection points of a circle (in a given plane) and a sphere surface (using 10^-6 as a tolerance in equality).

Namespace: Demo3D.Common
Assembly: Demo3D.Common (in Demo3D.Common.dll) Version: 19.01.00
Syntax
C#
public static Vector3[] IntersectCircleSphere(
	Vector3 circleCenter,
	Vector3 circleNormal,
	double circleRadius,
	Vector3 sphereCenter,
	double sphereRadius
)

Parameters

circleCenter  Vector3
Center of the circle.
circleNormal  Vector3
Normal to the plane that the circle is in.
circleRadius  Double
Radius of the circle.
sphereCenter  Vector3
Center of the sphere.
sphereRadius  Double
Radius of the sphere.

Return Value

Vector3
null meaning no intersections (includes case where circle is contained in the sphere, or circle is completely on the surface), or a Vector3[2], containing the two intersections (which could be the same).
See Also