Had a delayed MLK day day off today, so watched the EMC race and got started on the new version. Its probably going to take a decent amount of time to finish. The math is easy, but a bit time consuming to do. And the GUI is going to take quite a while to figure out.
So part 1 of the math behind the calculator. Expect a mix of drawings showing what is going on, descriptions, and some equations. This post is mostly supporting math functions. Future posts will go into how these are used.
Part 2 post number: 106, movement of point on axle
Part 3 post number: 110, panhard movement
Part 4 post number: 113, roll centers and slopes
Part 5 post number: 114, anti values
Part 6 post number: 115, link forces
Part 7 post number: 119, pitch
Part 8 post number: 121, link sizing
Part 9 post number: 122, driveshafts
Part 10 post number: 123, shock movement
Part 11 post number: , shock install ratios
Part 12 post number: , shock spring stuff
Distance Between 2 Points
Example of uses: link length, frame separation, axle separation
This is used in two forms: 2D and 3D
Uses the Pythagorean theorem.
Point 1 as: x1 y1 z1
Point 2 as: x2 y2 z2
In 3D: distance = sqrt[ (x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2 ]
In 2D: distance = sqrt[ (x1-x2)^2 + (y1-y2)^2 ]
Rotation of 1 point about another in 2D
Example of uses: shock travel, finding wheel centers, panhard movement
Stationary point as: x0 y0
Rotating point start as: xi yi
Rotating point end as: x y
Angle of rotation: theta
The stationary point and rotation point start are translated such that the stationary point is at the origin.
The rotating point is the rotated about the origin by theta.
The points are translated such that the stationary point is back where it started.
x = (xi - xo) * cos(theta) - (yi - yo) * sin(theta) + xo
y = (yi - yo) * cos(theta) + (xi - xo) * sin(theta) + yo
Line Intersection in 2D
Example of uses: finding ICs, finding roll centers
2 lines for by pairs of points. Points 1 and 2 for line 1. Points 3 and 4 for line 2.
Point 1 as: x1 y1 z1
Point 2 as: x2 y2 z2
Point 3 as: x3 y3 z3
Point 4 as: x4 y4 z4
From
Wikipedia:
Code:
(((x1*y2)-(y1*x2))(x3-x4)) - ((x1-x2)((x3*y4)-(y3 * x4)))
Px = ---------------------------------------------------------
((x1-x2)(y3-y4))-((y1-y2)(x3-x4))
Code:
(((x1*y2)-(y1*x2))(y3-y4)) - ((y1-y2)((x3*y4)-(y3 * x4)))
Py = ---------------------------------------------------------
((x1-x2)(y3-y4))-((y1-y2)(x3-x4))
Distance Between 2 Infinite Lines
Example of use: distance from shocks to roll axis
2 lines for by pairs of points. Points 1 and 2 for line 1. Points 3 and 4 for line 2.
Point 1 as: x1 y1 z1
Point 2 as: x2 y2 z2
Point 3 as: x3 y3 z3
Point 4 as: x4 y4 z4
From various webpages:
Code:
| x2-x1 y2-y1 z2-z1|
| a1 b1 c1 |
| a2 b2 c2 |
Distance = ---------------------------------------------------
sqrt((b1c2-b2c1)^2 + (a1c2-a2c1)^2 + (a1b2-a2b1)^2)
Distance Between 2 Line Segments
Example of uses: distance between links, distance between shocks
2 lines for by pairs of points. Points 1 and 2 for line 1. Points 3 and 4 for line 2.
Credit
TLDR: parameterize lines, use math to find two closest points
if points are in line segments, calculate distance
if not, find parameter value for closest point to end of segment, check if on segment, calculate distance from end of segment to closest point on other segment, take lowest of distances from each end point
X and Z when Y equals 0
Example of use: points defining roll axis
Line defined by two points.
Point 1 as: x1 y1 z1
Point 2 as: x2 y2 z2
Find parameter for y=0 and solve for X and Z
t = -y1/(y2-y1)
x = x1+(x2-x1)*t
z = z1+(z2-z1)*t
Suspension Travel
Example of uses: find suspension travel
, concepts could be used for solving cantilevered setups
Done in 2D side view. Travel is measured at the lower control arm axle point.
Points are abbreviated.
Step 1: Find new LA_Z.
Add travel to ride LA_Z
Step 2: Find new LA_X.
Use Pythagorean's Theorem to find the delta X of the moved lower link: sqrt(lowerLength^2 - (LA_Z - LF_Z) ^2)
Check if frame location is in front of axle location
Y: Subtract the delta X from the LF_X
N: Add the delta X to the LF_X
Step 3: Solve the line between the axle points.
Find the angle between horizontal and the lower link.
Find the length between the UF and LA.
Find the length between the frame points and axle points.
Use law of cosines to find the angle between lower link and UF->LA.
Add the angles to find the angle between horizontal and axle.
Use trig to find delta x and delta y for axle and add to LA to get UA.