Relative Content

Tag Archive for javascriptmathsvgtrigonometry

How to get the max “width” of a regular polygon in JavaScript?

I have been playing with math equations to draw “regular” polygons (polygons with same length sides and angles). I haven’t quite been able to get it to work such that, given a desired width bounding square, the polygon will be no larger than that square based on its “longest dimension”.