Master merge

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs 2024-10-02 12:09:01 +02:00
parent b4d8b04d9e
commit 336fa9d002
No known key found for this signature in database
21 changed files with 189 additions and 157 deletions

View file

@ -1,12 +1,12 @@
import { cartesian2Polar, polar, radians } from "./angle";
import { point } from "./point";
import { pointFrom } from "./point";
describe("cartesian to polar coordinate conversion", () => {
it("converts values properly", () => {
expect(cartesian2Polar(point(12, 5))).toEqual(
expect(cartesian2Polar(pointFrom(12, 5))).toEqual(
polar(13, radians(Math.atan(5 / 12))),
);
expect(cartesian2Polar(point(5, 5))).toEqual(
expect(cartesian2Polar(pointFrom(5, 5))).toEqual(
polar(5 * Math.sqrt(2), radians(Math.PI / 4)),
);
});