i missed my practicals pt.2
Works on pygame. Install pygame using cmd: pip install pygame Download and run the code. This is an application of Biot-Savarts law on each side using the result- B = μo NI(sinA + sinB)/ 4πD (direction is in/out of the plane) Code finds cursor's position on the Cartesian plane and calculates the value of A, B and D accordingly from each side of polygon. I have also converted the screen point system into cartesian system such that the center of the window now behaves as origin (0,0). Each side is 100 units and positions of vertex are found by taking parametric positions of circumcircle of the polygon (parameter being multiple of central angle (360/n)). circum radius = a/sqrt(2-2cosA) ...