I'm doing a simulation of an integral by taking numbers between 0 and 1, so I can get a force components. But I always get wrong cosine values, for example, when I take a=1 (so it makes a 45º angle, and therefore "L" should be equal to "k"), I get a "k" bigger than "L".If someone can please look what's wrong I'd really apreciate.
from math import pi, sin,cos, atan
for n in s:
f=atan(n/a)
L=ko*(Q/N*)*cos(f)
k=ko*(Q/N)*sin(f)
y.append(k)
x.append(L)
yy=sum(y)
xx=sum(x)
print (xx,yy)