Appearance
geometry 
Ogma static toolbox for geometry purposes
geometry.computeCentroid(points) 
Returns the average of the specified points.
Arguments
- points 
Point[] 
Returns
geometry.distance(x1, y1, x2, y2) 
Compute the distance between two points (x1, y1) and (x2, y2).
Arguments
- x1 
number - y1 
number - x2 
number - y2 
number 
Returns
-  
numberDistance between the two points. 
geometry.getNormalOnEdge(edge, t) 
Returns the normal vector of the edge at t. Returns the normal at the source of the edge for t = 0 and at the target for t = 1
Arguments
- edge 
EdgeAn edge - t 
numberThe interpolation value bounded in [0;1]. 
Returns
-  
object{x,y} The normal to the edge at t 
geometry.getPointOnEdge(edge, t) 
Returns the point of the edge at t. Returns the source of the edge for t = 0 and at the target for t = 1
Arguments
- edge 
EdgeAn edge - t 
numberThe interpolation value bounded in [0;1]. 
Returns
-  
object{x,y} The position on the edge at t 
geometry.getQuadraticCurveControlPoint(x1, y1, x2, y2, curvature, dest?) 
Returns the control point used to draw a curved edge.
Arguments
- x1 
numberX position of the source - y1 
numberY position of the source - x2 
numberX position of the target - y2 
numberY position of the target - curvature 
numberThe curvature factor of the edge - dest? 
PointA Point to write in the result 
Returns
-  
PointThe control point used to draw a curved edge. 
geometry.getTangentOnEdge(edge, t) 
Returns the tangent vector of the edge at t. Returns the tangent at the source of the edge for t = 0 and at the target for t = 1
Arguments
- edge 
EdgeAn edge - t 
numberThe interpolation value bounded in [0;1]. 
Returns
-  
object{x,y} The tangent to the edge at t