|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
319 bytes
|
| Line | |
|---|
| 1 | import {sqrt} from "../math.js";
|
|---|
| 2 |
|
|---|
| 3 | const sqrt3 = sqrt(3);
|
|---|
| 4 |
|
|---|
| 5 | export default {
|
|---|
| 6 | draw(context, size) {
|
|---|
| 7 | const s = sqrt(size) * 0.6824;
|
|---|
| 8 | const t = s / 2;
|
|---|
| 9 | const u = (s * sqrt3) / 2; // cos(Math.PI / 6)
|
|---|
| 10 | context.moveTo(0, -s);
|
|---|
| 11 | context.lineTo(u, t);
|
|---|
| 12 | context.lineTo(-u, t);
|
|---|
| 13 | context.closePath();
|
|---|
| 14 | }
|
|---|
| 15 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.