1
0
Fork 0

chore(markdown): Updated Point.dy() docs

This commit is contained in:
Joost De Cock 2022-09-29 15:38:16 +02:00
parent 8e23c71415
commit 70c19a6219

View file

@ -2,45 +2,32 @@
title: Point.dy()
---
A point's `dy()` method returns the delta (in mm) along the Y-axis between this point and the point you pass it.
The `Point.dy()` method returns the delta (in mm) along the Y-axis between this
point and the point you pass it.
## Point.dy() signature
## Signature
```js
float point.dy(Point point)
```
## Point.dy() example
## Example
<Example part="point_dy">
An example of the Point.dy() method
<Example caption="An example of the Point.dy() method">
```js
({ Point, points, Path, paths, units, part }) => {
points.from = new Point(10, 40)
points.to = new Point(10, 10)
paths.line = new Path()
.move(points.from)
.line(points.to)
.setClass("dotted")
.setText(units(points.from.dy(points.to)), 'center')
return part
}
```
</Example>
```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")
```