(vertex1, vertex2)
| 1 | const TWO_PI = Math.PI * 2; |
| 2 | function inwardEdgeNormal(vertex1, vertex2) { |
| 3 | const dx = vertex2.x - vertex1.x; |
| 4 | const dy = vertex2.y - vertex1.y; |
| 5 | const edgeLength = Math.sqrt(dx * dx + dy * dy); |
| 6 | return { |
| 7 | x: -dy / edgeLength, |
| 8 | y: dx / edgeLength |
| 9 | }; |
| 10 | } |
| 11 | function outwardEdgeNormal(vertex1, vertex2) { |
| 12 | var n = inwardEdgeNormal(vertex1, vertex2); |
| 13 | return { |
no outgoing calls
no test coverage detected