29 April 2022 12:36:46 PM
geometry_test():
C version
Test geometry().
angle_box_2d_test():
angle_box_2d() computes P4 and P5, normal to
line through P1 and P2, and
line through P2 and P3,
and DIST units from P2.
DIST 1.000000
P1: 0.000000 0.000000
P2: 3.000000 0.000000
P3: 4.000000 2.000000
P4: 2.381966 1.000000
P5: 3.618034 -1.000000
DIST 1.000000
P1: 0.000000 0.000000
P2: 3.000000 0.000000
P3: 2.000000 -2.000000
P4: 3.618034 -1.000000
P5: 2.381966 1.000000
DIST 1.000000
P1: 3.000000 0.000000
P2: 3.000000 0.000000
P3: 2.000000 -2.000000
P4: 2.105573 0.447214
P5: 3.894427 -0.447214
ANGLE_CONTAINS_RAY_2D_TEST
ANGLE_CONTAINS_RAY_2D sees if a ray lies within an angle.
Vertex A
0: 1.000000
1: 0.000000
Vertex B
0: 0.000000
1: 0.000000
Vertex C
0: 1.000000
1: 1.000000
X Y Inside?
1 0 1
0.866025 0.5 1
0.5 0.866025 0
6.12323e-17 1 0
-0.5 0.866025 0
-0.866025 0.5 0
-1 1.22465e-16 0
-0.866025 -0.5 0
-0.5 -0.866025 0
-1.83697e-16 -1 0
0.5 -0.866025 0
0.866025 -0.5 0
1 -2.44929e-16 0
Vertex A
0: 1.000000
1: 0.000000
Vertex B
0: 0.000000
1: 0.000000
Vertex C
0: 0.000000
1: 1.000000
X Y Inside?
1 0 1
0.866025 0.5 1
0.5 0.866025 1
6.12323e-17 1 1
-0.5 0.866025 0
-0.866025 0.5 0
-1 1.22465e-16 0
-0.866025 -0.5 0
-0.5 -0.866025 0
-1.83697e-16 -1 0
0.5 -0.866025 0
0.866025 -0.5 0
1 -2.44929e-16 0
Vertex A
0: 1.000000
1: -1.000000
Vertex B
0: 0.000000
1: 0.000000
Vertex C
0: 0.000000
1: 1.000000
X Y Inside?
1 0 1
0.866025 0.5 1
0.5 0.866025 1
6.12323e-17 1 1
-0.5 0.866025 0
-0.866025 0.5 0
-1 1.22465e-16 0
-0.866025 -0.5 0
-0.5 -0.866025 0
-1.83697e-16 -1 0
0.5 -0.866025 0
0.866025 -0.5 1
1 -2.44929e-16 1
Vertex A
0: 1.000000
1: 0.000000
Vertex B
0: 0.000000
1: 0.000000
Vertex C
0: -1.000000
1: 0.000000
X Y Inside?
1 0 1
0.866025 0.5 1
0.5 0.866025 1
6.12323e-17 1 1
-0.5 0.866025 1
-0.866025 0.5 1
-1 1.22465e-16 1
-0.866025 -0.5 0
-0.5 -0.866025 0
-1.83697e-16 -1 0
0.5 -0.866025 0
0.866025 -0.5 0
1 -2.44929e-16 0
Vertex A
0: 1.000000
1: 0.000000
Vertex B
0: 0.000000
1: 0.000000
Vertex C
0: 0.000000
1: -1.000000
X Y Inside?
1 0 1
0.866025 0.5 1
0.5 0.866025 1
6.12323e-17 1 1
-0.5 0.866025 1
-0.866025 0.5 1
-1 1.22465e-16 1
-0.866025 -0.5 1
-0.5 -0.866025 1
-1.83697e-16 -1 1
0.5 -0.866025 0
0.866025 -0.5 0
1 -2.44929e-16 0
Vertex A
0: 1.000000
1: 0.000000
Vertex B
0: 0.000000
1: 0.000000
Vertex C
0: 1.000000
1: -0.010000
X Y Inside?
1 0 1
0.866025 0.5 1
0.5 0.866025 1
6.12323e-17 1 1
-0.5 0.866025 1
-0.866025 0.5 1
-1 1.22465e-16 1
-0.866025 -0.5 1
-0.5 -0.866025 1
-1.83697e-16 -1 1
0.5 -0.866025 1
0.866025 -0.5 1
1 -2.44929e-16 0
ANGLE_DEG_2D_TEST
ANGLE_DEG_2D computes an angle.
X Y Theta ATAN2(y, x), ANGLE_DEG_2D
1.000 0.000 0.000 0.000 0.000
0.866 0.500 30.000 30.000 30.000
0.500 0.866 60.000 60.000 60.000
0.000 1.000 90.000 90.000 90.000
-0.500 0.866 120.000 120.000 120.000
-0.866 0.500 150.000 150.000 150.000
-1.000 0.000 180.000 180.000 180.000
-0.866 -0.500 210.000 -150.000 210.000
-0.500 -0.866 240.000 -120.000 240.000
-0.000 -1.000 270.000 -90.000 270.000
0.500 -0.866 300.000 -60.000 300.000
0.866 -0.500 330.000 -30.000 330.000
1.000 -0.000 360.000 -0.000 360.000
ANGLE_RAD_ND_TEST
ANGLE_RAD_ND computes an angle.
X Y Theta ATAN2(y, x), ANGLE_RAD_ND
1.000 0.000 0.000 0.000 0.000
0.866 0.500 30.000 30.000 0.524
0.500 0.866 60.000 60.000 1.047
0.000 1.000 90.000 90.000 1.571
-0.500 0.866 120.000 120.000 2.094
-0.866 0.500 150.000 150.000 2.618
-1.000 0.000 180.000 180.000 3.142
-0.866 -0.500 210.000 -150.000 2.618
-0.500 -0.866 240.000 -120.000 2.094
-0.000 -1.000 270.000 -90.000 1.571
0.500 -0.866 300.000 -60.000 1.047
0.866 -0.500 330.000 -30.000 0.524
1.000 -0.000 360.000 -0.000 0.000
BALL01_VOLUME_TEST
BALL01_VOLUME returns the volume of the unit ball.
Volume = 4.18879
CIRCLE_DIA2IMP_2D_TEST
CIRCLE_DIA2IMP_2D converts a diameter to an
implicit circle in 2D.
P1:
0: -0.080734
1: 6.546487
P2:
0: 4.080734
1: -2.546487
The implicit circle:
Radius = 5.000000
Center = ( 2.000000, 2.000000 )
CIRCLE_IMP_POINT_DIST_2D_TEST
CIRCLE_IMP_POINT_DIST_2D finds the
distance from a point to a circle.
The circle:
Radius = 5.000000
Center = ( 0.000000, 0.000000 )
X Y D
-5.631634 9.126352 9.487128
6.590185 1.233909 4.466885
-1.693858 -8.677625 7.291799
-4.848444 -7.800864 7.704602
-9.123420 2.679314 8.087986
-8.765455 -1.009221 7.269920
-1.973874 5.093470 2.199912
5.945739 -9.963233 10.469853
7.950081 -2.984953 6.863945
-8.109105 -9.727662 11.635506
CIRCLE_LUNE_ANGLE_BY_HEIGHT_2D_TEST
CIRCLE_LUNE_ANGLE_BY_HEIGHT_2D computes the angle of a
circular lune based on the 'height' of the circular triangle.
R H Angle
2.000000 -2.000000 6.283185
2.000000 -1.666667 5.111814
2.000000 -1.333333 4.601048
2.000000 -1.000000 4.188790
2.000000 -0.666667 3.821266
2.000000 -0.333333 3.476489
2.000000 0.000000 3.141593
2.000000 0.333333 2.806696
2.000000 0.666667 2.461919
2.000000 1.000000 2.094395
2.000000 1.333333 1.682137
2.000000 1.666667 1.171371
2.000000 2.000000 0.000000
CIRCLE