Prefer arrow functions (#2344)

This commit is contained in:
Lipis 2020-11-06 22:06:39 +02:00 committed by GitHub
parent e05acd6fd9
commit a20f3240fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 304 additions and 336 deletions

View file

@ -6,18 +6,21 @@ import { Line, Direction, Point } from "./ga";
* vector `(x, y)`.
*/
export function from(point: Point): Point {
return [0, 0, 0, 0, point[4], point[5], 0, 0];
}
export const from = (point: Point): Point => [
0,
0,
0,
0,
point[4],
point[5],
0,
0,
];
export function fromTo(from: Point, to: Point): Direction {
return GA.inormalized([0, 0, 0, 0, to[4] - from[4], to[5] - from[5], 0, 0]);
}
export const fromTo = (from: Point, to: Point): Direction =>
GA.inormalized([0, 0, 0, 0, to[4] - from[4], to[5] - from[5], 0, 0]);
export function orthogonal(direction: Direction): Direction {
return GA.inormalized([0, 0, 0, 0, -direction[5], direction[4], 0, 0]);
}
export const orthogonal = (direction: Direction): Direction =>
GA.inormalized([0, 0, 0, 0, -direction[5], direction[4], 0, 0]);
export function orthogonalToLine(line: Line): Direction {
return GA.mul(line, GA.I);
}
export const orthogonalToLine = (line: Line): Direction => GA.mul(line, GA.I);