I need to calculate the adjacent angle of a right-angled triangle formed by a rectangle that is dictated by two sets of points. My plan is to use offset () for two elements to get the absolute position coordinates, and then determine the inside corner from the lower left corner of this implied frame so that I can rotate the thin rectangular element with css.
Possible?
The only part I would not know how to do right off the bat is the trigonometry syntax, and do I need an external library for this.
* Note: I understand that css rotate will rotate around the center of the element, so I would have to shift the rectangle to compensate.
source
share