Hi! This is my problem. I have created stability codes for my self driving motercycle in python. I am by far most comfortable in python. However, I need this particular math to run on my arduino uno. I did my best to convert it, and it failed. I have added print() and serial.println() commands to track bugs. Here is the python code and my arduino attempt. Please help me make my serial.println() results exactly match the print() results. Thanks!

Python:

```
from math import sin, cos, atan, asin, sqrt, radians
w = 1.2 #wheelbase
v = 6 #speed in meters/sec of bike
g = 9.8 #constant of gravity in meters/sec
r = 10000000000 #radius of the turn
height = 0.75 #height of the center of mass
h = .5 #half of the length of the handlebar
t = 0.035 #half of the width of the tire
l = 0.8381 #length of the body of the actuator + 1.5 of the length of the fully extended actuator
c = 72 #caster angle in degrees
rate = 0.22987 #rate of motor
cel = 0.8381 #current extention length of actuator
c = radians(c)
angle = (w*cos(atan(v**2/g*r)+asin(t*(sin(c)/(height-t)))))/r*cos(c) #needed steer angle of bike for desired turn
print(angle)
rawdist = (sqrt((l+h*sin(angle))**2+((h-h*cos(angle))**2))) #distance that the actuator must travel
print(rawdist)
rawdist = float('{:.3f}'.format(rawdist))
print(rawdist)
dist = rawdist-cel #total distance from actuator mount to new place to move
print(dist)
sec = dist/rate #number of seconds for the motors to run to make the needed changes to the bike handle bar poss
print(sec)
```

arduino:

```
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
bool once = false;
float w = 1.2; //wheelbase
float v = 6; //speed in meters/sec of bike
float g = 9.8; //constant of gravity in meters/sec
float r = 10000000000; //radius of the turn
float height = 0.75; //height of the center of mass
float h = .5; //half of the length of the handlebar
float t = 0.035; //half of the width of the tire
float l = 0.8381; //length of the body of the actuator + 1.5 of the length of the fully extended actuator
float c = radians(72); //caster angle in degrees
float rate = 0.22987; //rate of motor
float cel = 0.8381; //current extention length of actuator
void loop() {
if (once == false){
c = radians(c);
float angle = (w*cos(atan(sq(v)/g*r)+asin(t*(sin(c)/(height-t)))))/r*cos(c); //needed steer angle of bike for desired turn
Serial.println(angle);
float rawdist = (sqrt(sq(l+h*sin(angle))+(sq(h-h*cos(angle))))); //distance that the actuator must travel
Serial.println(rawdist);
rawdist = float(rawdist, 3);
Serial.println(rawdist);
float dist = rawdist-cel; //total distance from actuator mount to new place to move
Serial.println(dist);
float sec = dist/rate; //number of seconds for the motors to run to make the needed changes to the bike handle bar poss
Serial.print(sec);
once = true;
}
}
```