BigKevSexyMan
Member
I'm having some problems with Math.sin and co. Here's were my coding is so far.
@angle = 270
angle_to_rad = @angle * Math::PI / 180
print angle_to_rad
y_increase = Math.sin(angle_to_rad)
x_increase = Math.cos(angle_to_rad)
print x_increase.to_s + ", " + y_increase.to_s
print y_increase / x_increase
Now, I should be getting a divide by 0 error, but these are the results I get in the order of the prints.
4.71238898038469 -angle_to_rad
-1.83690953073357e-016, -1.0 -x_increase.to_s + ", " + y_increase.to_s
5.4439262427946150e+015 -y_increase / x_increase
x_increase is supposed to be a 0
This throws me WAY off here and I need to figure out what the problem is.
@angle = 270
angle_to_rad = @angle * Math::PI / 180
print angle_to_rad
y_increase = Math.sin(angle_to_rad)
x_increase = Math.cos(angle_to_rad)
print x_increase.to_s + ", " + y_increase.to_s
print y_increase / x_increase
Now, I should be getting a divide by 0 error, but these are the results I get in the order of the prints.
4.71238898038469 -angle_to_rad
-1.83690953073357e-016, -1.0 -x_increase.to_s + ", " + y_increase.to_s
5.4439262427946150e+015 -y_increase / x_increase
x_increase is supposed to be a 0
This throws me WAY off here and I need to figure out what the problem is.