DEV Community

sehdev kumar
sehdev kumar

Posted on

Using D3js, How to find the x,y coordinates after rotation respect to centre of rectangle in plan?

I tried using this
x= (x-c1)*con(rotation)-(y-c2)*sin(rotation)+c1;
y
= (x-c1)*sin(rotation)+(y-c2)*cos(rotation)+c2;
where c1,c2 is the centre points of object or rectangle.

Help me give me proper solution......

Top comments (0)