Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
17 lines
329 B
JavaScript
17 lines
329 B
JavaScript
import {sqrt} from "../math.js";
|
|
|
|
const tan30 = sqrt(1 / 3);
|
|
const tan30_2 = tan30 * 2;
|
|
|
|
export default {
|
|
draw(context, size) {
|
|
const y = sqrt(size / tan30_2);
|
|
const x = y * tan30;
|
|
context.moveTo(0, -y);
|
|
context.lineTo(x, 0);
|
|
context.lineTo(0, y);
|
|
context.lineTo(-x, 0);
|
|
context.closePath();
|
|
}
|
|
};
|