1
0
Fork 0
freesewing/markdown/dev/reference/api/point/dy/en.md

48 lines
967 B
Markdown
Raw Normal View History

---
2021-10-16 15:42:30 +02:00
title: Point.dy()
---
2021-10-16 15:42:30 +02:00
A point's `dy()` method returns the delta (in mm) along the Y-axis between this point and the point you pass it.
2021-11-06 19:03:54 +01:00
## Point.dy() signature
```js
float point.dy(Point point)
```
2021-11-06 19:03:54 +01:00
## Point.dy() example
2021-10-16 15:42:30 +02:00
<Example
part="point_dy"
caption="An example of the Point.dy() method"
/>
```js
let { Point, points, Path, paths } = part.shorthand()
points.from = new Point(10, 10)
points.to = new Point(80, 70)
paths.line = new Path()
.move(points.from)
.line(points.to)
.attr("class", "dashed")
points.totop = points.from.shift(0,points.from.dx(points.to))
paths.line_dx = new Path()
.move(points.from)
.line(points.totop)
.attr("class", "dashed")
points.text_dy = points.totop
.shiftFractionTowards(points.to, 0.4)
.attr("data-text", points.from.dy(points.to)+"mm")
.attr("data-text-class", "text-sm fill-note right")
paths.line_dy = new Path()
.move(points.to)
.line(points.totop)
.attr("class", "dashed")
```