ProtoFlux:Line Circle Intersections: Difference between revisions

From Resonite Wiki
create page
 
Fixed node visual.
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{#Invoke:ProtoFlux|GenerateUI
{{#Invoke:ProtoFlux|GenerateUI
|Name=Line Circle Intersections
|Name=Line Circle Intersections
|Category=Math
|Category=Geometry 2D
|Inputs=
|Inputs=
[
[
Line 43: Line 43:
=== Intersection1 ([[Type:float2|float2]]) ===
=== Intersection1 ([[Type:float2|float2]]) ===
The second point of intersection between the line and circle. This is the point that occurs "earlier" in the intersection when tracing the line from <code>LinePoint0</code> to <code>LinePoint1</code>. If there are fewer than two intersections, this value is <code>[NaN; NaN]</code>.
The second point of intersection between the line and circle. This is the point that occurs "earlier" in the intersection when tracing the line from <code>LinePoint0</code> to <code>LinePoint1</code>. If there are fewer than two intersections, this value is <code>[NaN; NaN]</code>.
== Examples ==
<gallery widths=400px heights=320px>
File:ProtoFlux Example Line Circle Intersections.webp|alt=Center=0,0 Radius=1 LinePoint0=0,2 LinePoint1=0,0; Outputs: IntersectionCount=2 Intersection0=0,1 Intersection1=0,1|An example of the Line Circle Intersections node, where a circle centered at <code>(0,0)</code> and radius <code>1</code> intersects with a line defined by the points <code>(0,2)</code> and <code>(0,0)</code> at the points <code>(0,-1)</code> and <code>(0,1)</code>.
</gallery>


[[Category:ProtoFlux:Math:Geometry2D]]
[[Category:ProtoFlux:Math:Geometry2D]]

Latest revision as of 06:12, 30 June 2024

Line Circle Intersections
Center
IntersectionCount
Radius
Intersection0
LinePoint0
Intersection1
LinePoint1
Geometry 2D

The Line Circle Intersections node determines how many times a line defined by two points intersects a circle and where said intersections occur.

Inputs

Center (float2)

Center of the circle.

Radius (float)

Radius of the circle.

LinePoint0 (float2)

First point of the line.

LinePoint1 (float2)

Second point of the line.

Outputs

IntersectionCount (int)

The amount of intersections of the defined line and circle. This is at most two.

Intersection0 (float2)

The first point of intersection between the line and circle. This is the point that occurs "later" in the intersection when tracing the line from LinePoint0 to LinePoint1. If there does not exist any intersection, this value is [NaN; NaN].

Intersection1 (float2)

The second point of intersection between the line and circle. This is the point that occurs "earlier" in the intersection when tracing the line from LinePoint0 to LinePoint1. If there are fewer than two intersections, this value is [NaN; NaN].

Examples