2D
Samples
Right Triangle (RightTriangle)
Enter any two of side ab, height, side ca and the angle at a, then execute to calculate and output the items not entered


- ab
- Base length
- h
- Height
- ca
- Hypotenuse length
- angle
- Angle
- out_ab
- Base length (output)
- out_h
- Height (output)
- out_ca
- Hypotenuse length (output)
- out_angle
- Angle (output)
Example

- ab
- 3.0
- h
- 4.0
- ca
- angle
- out_ab
- 3.0
- out_h
- 4.0
- out_ca
- 5.0
- out_angle
- 53.13
Formulas
\begin{align} \theta =& angle*\frac{\pi}{180} \\ h =& ab \cdot tan\theta &= ca \cdot sin\theta \\ ab =& ca \cdot cos\theta \end{align}
Polygon Enclosed by Points (PolygonArea)
Outputs the area and perimeter of a polygon connecting up to 10 points on the coordinate plane


- points
- Point coordinates [x1,y1,x2,y2...]
- n
- Number of points
- area
- Area
- perimeter
- Perimeter
Example

- poits
- [0.0,0.0] [2.0,0.0] [3.0,2.0] [1.5,2.5] [-1.0,2.0]
- n
- 5
- area
- 7.0
- perimeter
- 10.60
Formulas
\[ area = \frac{1}{2} \left|\sum_{j=1}^{n} (x_{j}-x_{j+1})*(y_{j}+y_{j+1})\right| \] \[ perimeter = \sum_{j=1}^{n} \sqrt{(x_{j}-x_{j+1})^{2}+(y_{j}-y_{j+1})^{2}}\ \]
Inscribed Circle of a Triangle (TriangleInCircle)
Outputs the radius and area of the inscribed circle of a triangle with the three side lengths specified


- ab
- Length of side 1
- bc
- Length of side 2
- ca
- Length of side 3
- r
- Radius
- area
- Area
Example

- ab
- 3.0
- bc
- 4.0
- ca
- 5.0
- r
- 1.0
- area
- 3.14
Formulas
\[ s = \frac{ab+bc+ca}{2} \] \[ r = \frac{\sqrt{s(s-ab)(s-bc)(s-ca)}}{s} \] \[ area = \pi r^{2} \]
Circumscribed Circle of a Triangle (TriangleCircumCircle)
Outputs the radius and area of the circumscribed circle of a triangle with the three side lengths specified


- ab
- Length of side 1
- bc
- Length of side 2
- ca
- Length of side 3
- r
- Radius
- area
- Area
Example

- ab
- 3.0
- bc
- 4.0
- ca
- 5.0
- r
- 2.5
- area
- 19.64
Formulas
\[ s = \frac{ab+bc+ca}{2} \] \[ r = \frac{ab\cdot bc\cdot ca}{4\sqrt{s(s-ab)(s-bc)(s-ca)}} \] \[ area = \pi r^{2} \]
Inscribed Circle of a Regular Polygon (RegularPolygonInCircle)
Outputs the radius and area of the inscribed circle of a regular polygon with the side length specified


- l
- Side length
- n
- Number of sides
- r
- Radius
- area
- Area
Example

- l
- 1.0
- n
- 5
- r
- 0.69
- area
- 1.49
Formulas
\[ r = \frac{l}{2tan\frac{\pi}{n}} \] \[ area = \pi r^{2} \]
Circumscribed Circle of a Regular Polygon (RegularPolygonCircumCircle)
Outputs the radius and area of the circumscribed circle of a regular polygon with the side length specified


- l
- Side length
- n
- Number of sides
- r
- Radius
- area
- Area
Example

- l
- 1.0
- n
- 5
- r
- 0.85
- area
- 2.27
Formulas
\[ r = \frac{l}{2sin\frac{\pi}{n}} \] \[ area = \pi r^{2} \]
Distance and angle between two points (LinearPtoP)

- p1
- Point 1 [x,y]
- p2
- Point 2 [x,y]
- distance
- Distance
- angle
- Angle
Example

- p1
- [-6.0,-3.0]
- p2
- [5.0,4.0]
- distance
- 13.038
- angle
- 32.471
Formulas
\[ distance = \sqrt{(p2_x-p1_x)^{2}+(p2_y-p1_y)^{2}} \] \[ angle = atan2(p2_y-p1_y, p2_x-p1_x) \]
In the formulas, p1[0] is written as \(p1_x\) and p1[1] as \(p1_y\)
Intersection and angle of two lines (Intersection)
- Line1
- Line 1 [start x, start y, end x, end y]
- Line2
- Line 2 [start x, start y, end x, end y]
- point
- Intersection
- angle
- Angle
Example

- Line1
- [-10, -7, 10, 3]
- Line2
- [-10, 13.4, 10, -10.6]
- point
- [2,-1]
- angle
- -76.759
Formulas
Convert L1 to a linear function (ax+b)
\[
\begin{align}
P1=&(L1[0,0],L1[0,1]) \\
P2=&(L1[1,0],L1[1,1]) \\
a1=&\frac{(P2_y-P1_y)}{(P2_x-P1_x)} \\
b1=&\frac{(P2_x*P1_y-P1_x*P2_y)}{(P2_x-P1_x)}
\end{align}
\]
Likewise convert L2 to a linear function (ax+b) and calculate \(a2,b2\)
From L1 and L2
\[
\begin{align}
point_x = &\frac{(b2-b1)}{(a1-a2)} \\
point_y = &a1*point_x+b1 \\
angle=&tan^{-1}\left(\frac{a2-a1}{1+a1*a2} \right)
\end{align}
\]
Rotation around the origin (PointRotate)

- p
- Point [x,y]
- angle
- Rotation angle
- out_point
- Coordinates after rotation
Example

- p
- [4, 4]
- angle
- 90.0
- out_point
- [-4, 4]
Formulas
\[ \begin{align} \theta =& angle\frac{\pi}{180} \\ outp_x =& p_x*cos\theta-p_y*sin\theta \\ outp_y =& p_x*sin\theta+p_y*cos\theta \\ \end{align} \]
In the formulas, p[0] is written as \(p_x\) and p[1] as \(p_y\)
Cartesian to Polar Coordinates (PolarCoordinates)
Converts Cartesian coordinates to polar coordinates


- p
- Point [x,y]
- length
- Length
- angle
- Angle
Example

- p
- [1.0,0.8]
- length
- 1.28
- angle
- 38.66
Formulas
\begin{align} length =& \sqrt{p_x^{2}+p_y^{2}} \\ \theta =& tan^{-1}\frac{p_y}{p_x} \\ angle =& \frac{180}{\pi}\theta \end{align}
In the formulas, p[0] is written as \(p_x\) and p[1] as \(p_y\)
The quadrant problem for \(\theta\) can be avoided as follows.
\[\theta = atan2(p_y,p_x) \]
Polar to Cartesian Coordinates (CartesianCoordinates)
Converts polar coordinates to Cartesian coordinates


- length
- Length
- angle
- Angle
- p
- Point [x,y]
Example

- length
- 2.0
- angle
- 30.0
- p
- [1.73,1.00]
Formulas
\begin{align} \theta =& angle\frac{\pi}{180} \\ p_x =& length\cdot cos\theta \\ p_y =& length\cdot sin\theta \end{align}
In the formulas, p[0] is written as \(p_x\) and p[1] as \(p_y\)
Finding the Center and Radius of the Circle Through Three Points on a Plane (GetCenter2D)
Find the center and radius of the circle through three points on a plane

- Point A
- Point A [x,y]
- Point B
- Point B [x,y]
- Point C
- Point C [x,y]
- p0
- Center [x,y]
- r
- Radius
Example

- Point A
- [-4, 2]
- Point B
- [3, -1]
- Point C
- [1, 6]
- p0
- [0.128, 1.965]
- r
- 4.128
Formulas
\[ a = \begin{bmatrix} A_x & A_y & 1 \\ B_x & B_y & 1 \\ C_x & C_y & 1 \end{bmatrix} \] \[ bx = \begin{bmatrix} A_x^{2}+A_y^{2} & A_y & 1 \\ B_x^{2}+B_y^{2} & B_y & 1 \\ C_x^{2}+C_y^{2} & C_y & 1 \end{bmatrix} \] \[ by = \begin{bmatrix} A_x^{2}+A_y^{2} & A_x & 1 \\ B_x^{2}+B_y^{2} & B_x & 1 \\ C_x^{2}+C_y^{2} & C_x & 1 \end{bmatrix} \] \begin{align} p0_x=&-\left(\frac{bx}{2a}\right) \\ p0_y=&-\left(\frac{by}{2a}\right) \\ r=&\sqrt{(A_x-p0_x)^2+(A_y-p0_y)^2} \end{align}
In the formulas, A[0] is written as \(A_x\) and A[1] as \(A_y\)




