summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metapost/luamesh/luamesh.mp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-07-11 20:32:11 +0000
committerKarl Berry <karl@freefriends.org>2022-07-11 20:32:11 +0000
commit55becbb866a380c27a34987294ae988c4d038925 (patch)
treeea088de8e036e1fe46c37663ab77f2f4c8201154 /Master/texmf-dist/metapost/luamesh/luamesh.mp
parent7b74f7eb81fc3a17c34773731dd15345ba02617e (diff)
luamesh (11jul22)
git-svn-id: svn://tug.org/texlive/trunk@63875 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost/luamesh/luamesh.mp')
-rw-r--r--Master/texmf-dist/metapost/luamesh/luamesh.mp22
1 files changed, 22 insertions, 0 deletions
diff --git a/Master/texmf-dist/metapost/luamesh/luamesh.mp b/Master/texmf-dist/metapost/luamesh/luamesh.mp
new file mode 100644
index 00000000000..4e6d3e09e23
--- /dev/null
+++ b/Master/texmf-dist/metapost/luamesh/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