Jump to content

Need help with maths homework


Stealthbomber

Recommended Posts

This might turn out to be pretty straightforward but I'm struggling to figure out an elegant way to do it.

 

Thing is, I need to find a way to mathmatically calculate the results so I can pump the numbers into a spreadsheet and then use it to work out the same calculation for a variety of different options.

I know I could do a scale drawing and use it to find a single result but that's gonna be a PITA to repeat for different measurements, hence the need for a mathematical solution.

 

Here's the deal...

 

We're talking about cars with pop-up headlights.

When the headlights pop up we will assume that the lens is perfectly vertical.

If the headlight doesn't pop up all the way then the lens won't be vertical. It'll be tilted forward.

I need to find a way to calculate the angle at which the lens is for any given height the headlight is raised.

 

I did a sketch which might help explain things.

 

Headlamps.jpg

 

As you can see, in example "A" the headlight is fully raised (20cm above the bonnet-line) and is vertical.

You can see that the angle between the lens and the ground (represented by the dotted line) is a right-angle.

 

Sooo....

 

Let's say the headlamp only raises half way up, as shown in example "B".

The pivot point is the same, the shape of the headlight is the same but this time it's only raised 10cm above the bonnet line.

Now we need to calculate angle X. That's the angle between the lens and the ground.

 

To be clear, what I need is a mathematical solution that'll allow me to replace the different values with alternate numbers and get a value for X with any shape headlight pod.

 

Any offers?

Link to post
Share on other sites

...haven't done trig in 5+ years... give me a moment ;) ummm... I know it's the triangle exterior therom, I just totally forgot application lol.

 

EDIT

 

Looking on, I doubt there will be a "plug in x" equation for this, as the COS/SIN will change each time. I may be wrong as I'm working off of very old knowledge (I've gotten too used to CALC ;) ).

Link to post
Share on other sites
I'd say something dealing w/ the law of cosine, but what do I know, I'm a BME undergrad XD.

 

Yeah I'd say you're spot on. Use that twice and you should get your answer. There's no avoiding the cosine terms because the "headlamp" triangle can be any arbitrary triangle. I may have goofed in the following so correct me if I did.

 

trigproblem.jpg

I'm just gonna give everything a name so it works for whatever your headlamp might be. From what I understand, you want to measure what I labeled as B in the diagram and compute the angle x from it, using what you know about the shape of the headlamp. It's not complicated or hard, but I'll be detailed to avoid any confusion.

 

Don't worry about the part of the headlamp hidden in the bonnet, as I don't think that matters. The blue terms you know: you know the top length A, you know the top corner angle beta and you measured B. The green term is your final solution: the angle x. The red terms are things you'll need to find along the way: the length C, the angle phi and the angle psi. So first compute C:

 

C = sqrt[ A^2 + B^2 -2ABcos(beta) ]

 

Using the number you got for C, use law of cosines again to get the angle phi:

 

phi = arccos[ (A^2 + C^2 - B^2) / (2AC) ]

 

Then you can get psi. In degrees:

 

psi = 180 - beta - phi

 

And you can finally get x. In degrees:

 

x = 180 - psi - gamma

 

I'm assuming you know the black term gamma (i.e., the angle between the bonnet and the ground). If not, you can just compute it if you know the angles and side lengths of the headlamp and consider the case of the fully upright headlamp, where you know the front face is at right angle with the ground and the bottom face is colinear with the bonnet.

Link to post
Share on other sites
[stuff]

TL; DR

 

Sorry, just joking. :D

Absolutely brilliant. Cheers.

I'll have a sit-down with it a bit later on and try and pump some numbers into it to see what happens.

 

Regarding the angle gamma, I'd rather calculate it rather than measure it simply because car bonnets tend to be curved and it might be tough to measure accurately.

 

In practice, I'll be removing the headlamp pods, measuring the lengths A & B, and angle beta then fitting the new lights, re-measuring length B and then trying to calculate angle X.

 

slu's solution looks right as a general case. You might be able to simplify it if you can find other geometric relationships (e.g. the triangle for the headlamp is nearly but not quite isosceles).

TBH, I kinda fiddled some of the numbers before posting this.

The headlamp pods I'm looking at are actually 35cm long and that does create an almost perfect isosoles triangle.

I deliberately changed the numbers just to avoid settling on an "easy" solution that might not work with oddly sized pods in future.

 

 

FWIW, the reason for this is because a friend has just purchased some tiny projector-headlamps for their car which, when fitted, won't require for the lamps to pop up as far.

They come with a cheap plastic surround that means the electrictronic beam adjusters (the headlights are adjustable for height and steer into corners etc) will no longer work.

We figure it'll be better to fit the new headlights onto a plate which can be bolted to the original adjusters and allow the use of the OEM adjuster mechanism.

Once I can work how much the angle of the lens tilts forward when the headlight isn't raised to the normal height I can use another bit of trig' (a simple bit which I can handle) to calculate how much I need to shim the bottom of the new plate so the headlamps point in the correct direction.

 

I know "trial & error" would probably solve the problem without too much hassle but I wanted to try ancd find a way to do it "properly".

Thing is, the sketches I did, above, are almost to scale. It's easy to see that when the light only pops up half the distance angle-x changes a helluva lot and I don't want to make a halfassed job of this.

Link to post
Share on other sites

I'd agree with Slu except for one thing, his first equation. If you're going to use the Pythagoras Theorem (and I did too) to find C, why did you throw in -2ABCos(y)? The theorem is just A2+B2=C2. I am majoring in Mechanical Engineering so this isn't my specialty but remembering the basics I don't quite understand why you throw in the extra item.

Link to post
Share on other sites
I'd agree with Slu except for one thing, his first equation. If you're going to use the Pythagoras Theorem (and I did too) to find C, why did you throw in -2ABCos(y)? The theorem is just A2+B2=C2. I am majoring in Mechanical Engineering so this isn't my specialty but remembering the basics I don't quite understand why you throw in the extra item.

 

Chimpy is right. The "cross term" (-2ABcos(beta)) accounts for the fact that the edges A and B are not orthogonal. If beta > pi/2, you add length (cosine term is negative). If beta < pi/2, you take away length (cosine term is positive).

 

You could do the whole thing using only Pythagoras and simple trig relations but that would just involve re-deriving law of cosines, which I think is easiest done when you assume that sides A, B, C are vectors a, b, c, respectively, drawing their directions such as c = b - a. Since we're on a plane, say a = [ a1 a2 ], b = [ b1 b2 ], c = [ c1 c2 ]. We're interested in finding the length of c (C = norm(c ) ), and since we've described the vectors in orthogonal coordinates, we can use Pythagoras directly. norm(c )^2 = (b1-a1)^2 + (b2-a2)^2. If you expand this out, you will get the usual Pythagoras terms A^2 and B^2, but you'll also get a dot product term -2(a dot b ), which can be written alternately as -2ABcos(beta). In the case of a right angle beta, cos(beta) = 0 and you get Pythagoras back.

Link to post
Share on other sites

Heh, this is starting to get confusing now.

 

One thing I was thinking...

If we assume the lens IS perpendicular to the ground (and we CAN do that given that all we really want to find is the offset of the new angle-x for any given height the headlamps are raised) we can work out the angle between the top of the headlamp pod and the ground.

If we do that we can then bung in a new height and then recalculate the angle of the headlight pod relative to the ground.

 

I think it's possible to compare these two different angles to find the new angle of the lens.

 

Boy, I wish I'd paid more attention the day they taught this stuff at school. :D

 

Anyway, I'm off up to see the car (an old FIAT ;)) tomorrow so I'll have a proper read of Slu's ideas later on and try to cobble up some kind of suitable spreadsheet.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the use of session cookies.