diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
| commit | 97d5c458cfa039d857301e1ca7d5af3beb37131d (patch) | |
| tree | b460cd850d0537eb71806ba30358840377b27688 /static/inferno/man2/draw-point.2 | |
| parent | b89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff) | |
build: Better Build System
Diffstat (limited to 'static/inferno/man2/draw-point.2')
| -rw-r--r-- | static/inferno/man2/draw-point.2 | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/static/inferno/man2/draw-point.2 b/static/inferno/man2/draw-point.2 new file mode 100644 index 00000000..a64a3665 --- /dev/null +++ b/static/inferno/man2/draw-point.2 @@ -0,0 +1,66 @@ +.TH DRAW-POINT 2 +.SH NAME +Point \- +coordinate position +.SH SYNOPSIS +.EX +include "draw.m"; +draw := load Draw Draw->PATH; + +Point: adt +{ + x: int; + y: int; + + add: fn(p: self Point, q: Point): Point; + sub: fn(p: self Point, q: Point): Point; + mul: fn(p: self Point, i: int): Point; + div: fn(p: self Point, i: int): Point; + eq: fn(p: self Point, q: Point): int; + in: fn(p: self Point, r: Rect): int; +}; +.EE +.SH DESCRIPTION +.PP +The +.B Point +data type specifies a position in the integer grid. +.TP 10 +.BR x ", " y +The coordinate position. The coordinates increase to the right +.RI ( x ) +and down +.RI ( y ). +.TP +.IB p .add( q ) +Returns the point +.BI ( p .x+ q .x, +.IB p .y+ q .y)\fR. +.TP +.IB p .sub( q ) +Returns the point +.BI ( p .x\- q .x, +.IB p .y\- q .y)\fR. +.TP +.IB p .mul( i ) +Returns the point +.BI ( p .x* i , +.IB p .y* i )\fR. +.TP +.IB p .div( i ) +Returns the point +.BI ( p .x/ i , +.IB p .y/ i )\fR. +.TP +.IB p .eq( q ) +Returns non-zero if the points' coordinates are equal and zero otherwise. +.TP +.IB p .in( r ) +Returns non-zero if point +.I p +lies within rectangle +.I r +and zero otherwise. +.SH SEE ALSO +.IR draw-intro (2), +.IR draw-rect (2) |
