Search This Blog

Saturday, January 1, 2011

Arrays-2

#To verify orthogonality of sine and cosine functions
#Principle: Create two vctors X and Y using the values of sine
#and cosine for the same angle within relevant range.
#Show that sum of products xi.yi=0'
import Numeric, math
sum=0
for i in range(180):
    theta=math.pi*i/180
    x=math.cos(theta)
    y=math.sin(theta)
    sum+=x*y
print "The sum of products xi.yi=%e is negligible. Hence orthogonal in the range (0-180)degrees"%sum


by Prof. Purushothaman Vadakkedam

No comments:

Post a Comment