diff options
author | Norbert Preining <norbert@preining.info> | 2022-07-12 03:00:52 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-07-12 03:00:52 +0000 |
commit | 4d0c22ee19d3a09c266eadd4daf7d5064aff1b06 (patch) | |
tree | f57c394e8b540859eaf5d8546cedda96c8d3da0e /macros/luatex/latex/luamesh/metapost | |
parent | f38fd211142e080f2d76c320225eb1c75889aae6 (diff) |
CTAN sync 202207120300
Diffstat (limited to 'macros/luatex/latex/luamesh/metapost')
-rw-r--r-- | macros/luatex/latex/luamesh/metapost/luamesh.mp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/macros/luatex/latex/luamesh/metapost/luamesh.mp b/macros/luatex/latex/luamesh/metapost/luamesh.mp new file mode 100644 index 0000000000..4e6d3e09e2 --- /dev/null +++ b/macros/luatex/latex/luamesh/metapost/luamesh.mp @@ -0,0 +1,22 @@ +% metapost library for the lualatex package luamesh +% +vardef circumcircle(expr M,N,P)= + % Compute center and radius of the circoncircle of the triangle M N P + save a,b,c,circle,rad,center,x,y; + path circle; + pair center; + numeric a,b,c,x[],y[]; + x1 := xpart M; + y1 := ypart M; + x2 := xpart N; + y2 := ypart N; + x3 := xpart P; + y3 := ypart P; + 2*x1*a+2*y1*b+c=-(x1**2+y1**2); + 2*x2*a+2*y2*b+c=-(x2**2+y2**2); + 2*x3*a+2*y3*b+c=-(x3**2+y3**2); + center := (-a,-b); + rad := sqrt(a**2+b**2-c**2); + circle := fullcircle scaled (2.0*rad) shifted center; + circle +enddef |