Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beta = par['lam'] - alpha * pi / 180
# calculate the slope of the center of mass line
m = -umath.tan(beta)
# calculate the z intercept
# this the bicycle frame
if part == 'B':
b = -a / umath.cos(beta) - par['rR']
# this is the fork (without handlebar) or the fork and handlebar combined
elif part == 'S' or part == 'H':
b = -a / umath.cos(beta) - par['rF'] + par['w'] * umath.tan(beta)
# this is the handlebar (without fork)
elif part == 'G':
u1, u2 = fwheel_to_handlebar_ref(par['lam'], l1, l2)
b = -a / umath.cos(beta) - (par['rF'] + u2) + (par['w'] - u1) * umath.tan(beta)
else:
print part, "doesn't exist"
raise KeyError
return m, b, beta
Parameters
----------
lam : float
Steer axis tilt.
l1, l2 : float
The distance from the front wheel center to the handlebar refernce
center perpendicular to and along the steer axis.
Returns
-------
u1, u2 : float
'''
u1 = l2 * umath.sin(lam) - l1 * umath.cos(lam)
u2 = u1 / umath.tan(lam) + l1 / umath.sin(lam)
return u1, u2
Parameters
----------
lam : float
Steer axis tilt.
l1, l2 : float
The distance from the front wheel center to the handlebar refernce
center perpendicular to and along the steer axis.
Returns
-------
u1, u2 : float
'''
u1 = l2 * umath.sin(lam) - l1 * umath.cos(lam)
u2 = u1 / umath.tan(lam) + l1 / umath.sin(lam)
return u1, u2
Returns
-------
m : float
The slope of the line in the benchmark coordinate system.
b : float
The z intercept in the benchmark coordinate system.
'''
# beta is the angle between the x bike frame and the x pendulum frame, rotation
# about positive y
beta = par['lam'] - alpha * pi / 180
# calculate the slope of the center of mass line
m = -umath.tan(beta)
# calculate the z intercept
# this the bicycle frame
if part == 'B':
b = -a / umath.cos(beta) - par['rR']
# this is the fork (without handlebar) or the fork and handlebar combined
elif part == 'S' or part == 'H':
b = -a / umath.cos(beta) - par['rF'] + par['w'] * umath.tan(beta)
# this is the handlebar (without fork)
elif part == 'G':
u1, u2 = fwheel_to_handlebar_ref(par['lam'], l1, l2)
b = -a / umath.cos(beta) - (par['rF'] + u2) + (par['w'] - u1) * umath.tan(beta)
else:
print part, "doesn't exist"
raise KeyError
Returns
-------
m : float
The slope of the line in the benchmark coordinate system.
b : float
The z intercept in the benchmark coordinate system.
'''
# beta is the angle between the x bike frame and the x pendulum frame, rotation
# about positive y
beta = par['lam'] - alpha * pi / 180
# calculate the slope of the center of mass line
m = -umath.tan(beta)
# calculate the z intercept
# this the bicycle frame
if part == 'B':
b = -a / umath.cos(beta) - par['rR']
# this is the fork (without handlebar) or the fork and handlebar combined
elif part == 'S' or part == 'H':
b = -a / umath.cos(beta) - par['rF'] + par['w'] * umath.tan(beta)
# this is the handlebar (without fork)
elif part == 'G':
u1, u2 = fwheel_to_handlebar_ref(par['lam'], l1, l2)
b = -a / umath.cos(beta) - (par['rF'] + u2) + (par['w'] - u1) * umath.tan(beta)
else:
print part, "doesn't exist"
raise KeyError