Changeset 95 for trunk/Point.php
- Timestamp:
- Dec 6, 2021, 11:33:48 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Point.php
r92 r95 3 3 class Point 4 4 { 5 var$X;6 var$Y;5 public int $X; 6 public int $Y; 7 7 8 function __construct( $X,$Y)8 function __construct(int $X, int $Y) 9 9 { 10 10 $this->X = $X; … … 13 13 } 14 14 15 function NewPoint( $X, $Y)15 function NewPoint(int $X, int $Y): Point 16 16 { 17 17 $Point = new Point($X, $Y); … … 20 20 21 21 /* Linear interpolation between two points */ 22 function Interpolation(Point $P1, Point $P2, $X) 22 function Interpolation(Point $P1, Point $P2, $X): float 23 23 { 24 24 $Y = ($P2->Y - $P1->Y) / ($P2->X - $P1->X) * ($X - $P1->X) + $P1->Y;
Note:
See TracChangeset
for help on using the changeset viewer.