805 B
805 B
title |
---|
Point.angle() |
The Point.angle()
method returns the angle (in degrees) between this point
and the point passed into the method. An angle of 0° points to the right, and
the angle increases counterclockwise.
Signature
float point.angle(Point pointB)
Example
```js ({ Point, points, Path, paths, part }) => {points.sun = new Point(10, 5); points.moon = points.sun.shift(-15, 70); points.text = points.sun .shiftFractionTowards(points.moon, 0.8) .attr("data-text", points.sun.angle(points.moon)+"°") .attr("data-text-class", "text-sm fill-note center");
paths.line = new Path() .move(points.sun) .line(points.moon) .attr("class", "dashed");
return part }
</Example>