Book
Advanced Engineering Mathematics
Author
Erwin Kreyszig
Edition
8th Edition
clf() data=array([[0,0],[-1.5,0]]) phi=0 R=array([[cos(phi),-sin(phi)],[sin(phi),cos(phi)]]) data=dot(R, data) axis([-2,2,-2,3]) #print data[0,:], data[1,:] plot(data[0,:],data[1,:]) plot(0,0,'o') theta=pi-pi/1000 thetadot=0 t=0 dt=.2 tfinal=50 while(t<tfinal): t=t+dt theta=theta+thetadot*dt thetadot=thetadot-sin(theta)*dt R=[[cos(theta),-sin(theta)],[sin(theta),cos(theta)]] datanew=dot(R,data) plot(datanew[0,0],datanew[1,0]) #print datanew[0,0],datanew[1,0] plot(datanew[0,:],datanew[1,:]) ylim(-1.5,1.5) show()
Solution by:
- telugupraveenkumar,student,SNIST