33 include <math-base.scad>;
81 v3 = [(s1*s1 + s3*s3 - (s2*s2)) / (2*s1),
82 sqrt(s3*s3 - pow((s1*s1 + s3*s3 - (s2*s2)) / (2*s1), 2))]
84 (cw ==
true) ? [v1, v3, v2] : [v1, v2, v3];
155 (s ==
false) ? abs(sa) : sa;
169 let( sa =
is_left_ppp(p1=v[0], p2=v[1], p3=v[2]) / 2 )
170 (s ==
false) ? abs(sa) : sa;
185 ) = [ (v1[0] + v2[0] + v3[0])/3, (v1[1] + v2[1] + v3[1])/3 ];
353 ) = let (d = ((v2[1]-v3[1]) * (v1[0]-v3[0]) + (v3[0]-v2[0]) * (v1[1]-v3[1])))
355 : let (a = ((v2[1]-v3[1]) * ( t[0]-v3[0]) + (v3[0]-v2[0]) * ( t[1]-v3[1])) / d)
357 : let (b = ((v3[1]-v1[1]) * ( t[0]-v3[0]) + (v1[0]-v3[0]) * ( t[1]-v3[1])) / d)
function is_left_ppp(p1, p2, p3)
Test if a point is left, on, or right of an infinite line in a Euclidean 2d-space.
function distance_pp(p1, p2)
Compute the distance between two Euclidean points.
function triangle_area_lp(v, s=false)
Compute the signed area of a triangle given its vertex coordinates.
function triangle_ls2lp(v, cw=true)
Compute the vertex coordinates of a triangle given its side lengths.
function triangle_ppp2ls(v1, v2, v3)
Compute the side lengths of a triangle given its vertex coordinates.
function triangle_inradius_lp(v)
Compute the inradius of a triangle's incircle.
function triangle_centroid_ppp(v1, v2, v3)
Compute the centroid (geometric center) of a triangle.
function triangle_area_ppp(v1, v2, v3, s=false)
Compute the signed area of a triangle given its vertex coordinates.
function triangle_is_pit_ppp(v1, v2, v3, t)
Test if a point is inside a triangle in a Euclidean 2d-space using Barycentric.
function triangle_incenter_ppp(v1, v2, v3)
Compute the coordinate for the triangle's incircle.
function triangle_is_cw_ppp(v1, v2, v3)
Test the vertex ordering, or orientation, of a triangle.
function triangle_inradius_ppp(v1, v2, v3)
Compute the inradius of a triangle's incircle.
function triangle_centroid_lp(v)
Compute the centroid (geometric center) of a triangle.
function triangle_is_pit_lp(v, t)
Test if a point is inside a triangle in a Euclidean 2d-space using Barycentric.
function triangle_sss2lp(s1, s2, s3, cw=true)
Compute the vertex coordinates of a triangle given its side lengths.
origin2d
The origin point coordinate in 2d Euclidean space.
function triangle_incenter_lp(v)
Compute the coordinate for the triangle's incircle.
function triangle_lp2ls(v)
Compute the side lengths of a triangle given its vertex coordinates.
function triangle_is_cw_lp(v)
Test the vertex ordering, or orientation, of a triangle.