Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4151

Other programming languages • Re: JavaScript graph library, for embedding and drawing planar graphs in 2D and/or sphere surface

$
0
0
Finally I got the angle calculations and rotations right:
now OpenSCAD "edge3(v,w,c)" draw spherical arc from sphere projection of v to w, with center coordinate c
https://github.com/Hermann-SW/planar_gr ... ng.3D.2.js

Looking at the top mapped edges on sphere (corresponding to planar graph outer face), I first thought something is wrong. But it is not, and no edges intersect by the stereographic projection from north pole. Stereographic projection is angle preserving, which can be seen simplest by mapping of bottom right outer face vertex with biggest angle >270°:

Code:

./rjs node.straight_line_drawing.3D.2.js graphs/mp7.a 4 w
Screenshot from 2024-09-12 09-56-13.png

With more vertices it looks more familiar for C20:

Code:

./rjs node.straight_line_drawing.3D.2.js graphs/C20.a 4
Screenshot from 2024-09-12 09-57-12.png

Statistics: Posted by HermannSW — Thu Sep 12, 2024 8:11 am



Viewing all articles
Browse latest Browse all 4151

Trending Articles