View Full Version : Math Formula Required
I need to calculate the length of the side marked (?) of an oblique triangle.
All the formula I have don't match the known facts.
This is all I know, can the marked side be calculated?
Thankyou.
Ken_Shea 08-07-2006, 07:44 AM Kiwi,
Because I do not understand much of algebraic formulas, I have calculated similar needs right in my cad, this one is very simple.
This is in imperial so you will need to convert to Metric.
NC Cams 08-07-2006, 07:54 AM The angle inside the circle is 13.927123 deg
The length of the segment you'r looking for is 19.924348
Done via DesignView version DV50-10gb (English version), a superb paramertic CAD sketchpad program that I wouldn't trade for the world
RE-EDIT Great program providing you connect the dots properly - see later post END RE-EDIT
EDIT
To calculate, first drop a perpendicular line from the 6" radial line that is not colinear with the coliniear 20" and 6" lines. Extend it from the OD intersection up to the 20" and 6" colinear lines.
Now that you have a 90 deg angle, you should be able to figure out the lenght of the perpendicular drop.
Having this, you can figure the short length of the segment from the circle OD to the perpendicular drop/rise. Call this 6-x where x is the itsy bitsy length from circle OD to the construction line.
With the 5 deg angle and the length of the perpendicular and the true length of the '20+x' segment you should be able to do the calcs needed to find ?
It was easier and faster to use DesignView
END EDIT
Ken_Shea 08-07-2006, 08:14 AM Hmmmm....
What I get is 20.2692 for a 2D length, actual line length 20.345
Angle inside circle 17.1893
Caprirs 08-07-2006, 08:18 AM Using math only, you could find the equation for the circle:
(x-26)**2 + (y-0)**2 = 6**2
and the equation for the line:
mx + 0 = y where "m" is the slope of a -5 degree line
Substitute the line equation (already solved for y) into the circle equation. You will get two solutions since the line will intersect the circle twice.
NC Cams 08-07-2006, 08:29 AM MAJOR OOPS, Sorry.
Ken Shea is right on at 20.345. (20.345433 to 6 decimals)
The internal angle is 17.190 (17.189734 to 6 decimals)
When I resized the drawing I didn't catch that the CAD program picked up a different arc contact point which it does occasionally on a "resized" sketch.
This proves that you can't always trust what the CAD says (wedge) - you MUST do a reality check which I sadly failed to do in this instance. (wedge)
First DUH moment this week (wedge) - probably won't be the last.
Using math only, you could find the equation for the circle:
(x-26)**2 + (y-0)**2 = 6**2
and the equation for the line:
mx + 0 = y where "m" is the slope of a -5 degree line
Substitute the line equation (already solved for y) into the circle equation. You will get two solutions since the line will intersect the circle twice.
According to the time stamp on the post you are telling someone to solve a quadratic equation before 7 o'clock in the morning!!! Have a heart :)
lakeside 08-07-2006, 09:42 AM According to the time stamp on the post you are telling someone to solve a quadratic equation before 7 o'clock in the morning!!! Have a heart :)
Geof you maybe be the only one who would know the math even before 7:00AM
fpworks 08-07-2006, 12:00 PM Another math dork method :) use the Law of Cosines:
6^2 = 26^2 + ?^2 - 2*26*?*cos(5 deg)
solve for '?' = 20.3454 AND 31.4567 (with my HP, because I'm lazy)
Common sense (geometry of a triangle) throws out 31.4567
lakeside 08-07-2006, 12:30 PM 20.3454 how that # sound
Thanks to all who replied.
I can do it on my Cad program OK, I needed the formula to build in a VB program which calculates the cusp height on a curved surface.
Caprirs and fpworks have supplied what I need.
I'll now go and build into my program and see if I get the correct answer.
Also study NC Cams method.
NC Cams
Quote<To calculate, first drop a perpendicular line from the 6" radial line that is not colinear with the coliniear 20" and 6" lines. Extend it from the OD intersection up to the 20" and 6" colinear lines.
Now that you have a 90 deg angle, you should be able to figure out the lenght of the perpendicular drop.>
If I'm reading you right, I don't think I have enough info to calculate the perpendicular line? My attempt to understand attached.
Caprirs, fpworks......Both of these formula are a little over my head.
I'm not sure that I can use these as I need one answer as I'm building this formula into a VB program.
I'm hoping to get a formula or procedure that give one answer only if possible.
Tell me if I'm wrong.
tobyaxis 08-07-2006, 07:36 PM Caprirs, fpworks......Both of these formula are a little over my head.
I'm not sure that I can use these as I need one answer as I'm building this formula into a VB program.
I'm hoping to get a formula or procedure that give one answer only if possible.
Tell me if I'm wrong.
Kiwi,
If you are writing a VB Script for BobCad/Cam post in the BCC Forum under Scripts. BCC Scripting is slightly different than Regular Visual Basic. I'm sure The Bird will enjoy helping you with this Script. If it's not for BCC disreguard this post.
:cheers:
tobyaxis
Is 'The Bird' the BCC guru?
This is for a VB6 program I'm writing but if it is in BCC script, it is similiar enough for me to interpretate.
If I don't have any joy here, I'll post on the BCC forum.
birdmanzak 08-07-2006, 08:42 PM Using formulae gives you a more robust program. One where you should be able to easily modify any of the parameters and still get an answer without resorting to asking a CAD proggy to do it for you.
The attached pic should (I hope) make the cosine rule a little clearer (please excuse the messiness - my mouse-driven handwriting isn't the best).
There shouldn't be anything there that VB can't handle.
To calculate the vertical drop shown in post #12 you can use:
drop = c * arcsin(5)
where 'c' is the answer from the picture. Arcsin is sometimes expressed as sin raised to the power of -1. You also want to make sure VB is doing its calculations in degrees, or convert the angle to radians.
edit: In the formula, you can replace the +/- with just -, because you'll always want to measure to the close side of the circle which will obviously always be the shorter distance. That satisfies your requirement for "one answer".
tobyaxis 08-07-2006, 08:43 PM tobyaxis
Is 'The Bird' the BCC guru?
This is for a VB6 program I'm writing but if it is in BCC script, it is similiar enough for me to interpretate.
If I don't have any joy here, I'll post on the BCC forum.
He is the One. I beleave his name is Sorin. Great Guy, Very Smart. Tjones is very good as well as Sowen, Cely, Gandalf (Wolfgang), Glenn. There are so many Smart Guys there I can't remember then all. Post There, You'll see. :cheers:
birdmanzak
VB works in radians and I'm quite familiar with this.
Quote: Arcsin is sometimes expressed as sin raised to the power of -1>
This has me stumped at first glance. I'll need to study this and your diagram some, but looks like just what I'm after. Thankyou for your input.
birdmanzak 08-07-2006, 09:17 PM Kiwi:
The arcsin thing is just because it's a different way of writing it, and I wasn't sure which one you'd be familiar with. No big deal. See the piccy (I wish forums were better for expressing mathematical notation...).
NC Cams 08-07-2006, 09:33 PM Kiwi:
Takes some steps I didn't quite see or think thru well enough at the time - it was early in the morning and I wrote before I had fully THOUGHT what to say. I appologize for the haste.
Once you drop the perp line, you have a bunch of "knowns" or relations you can state in terms of something else:
The 2 @90 and the 5 deg external angles are now "given". The third external angle is now calculable at 85.
External triangle has sides of: ? (hypotenuse), 20+x and Y.
Internal triangle has sides of: 6 (hypotenuse), 6-x and Y.
Y = {((?**2) - ((20+x)**2)}**0.5
and
Y = {{36 - ((6-x)**2)}**0.5
Setting the Y's above equal nets the quadratic equation thingie that Geof got to.
But you also have:
Y / Sin 5 = ?/sin 90, now solve for ? in terms of Y
and
(20+x)/ Sin 85 = ?/ Sin 90, now solve for ? interms of x
At this point, you start plugging and chugging the math which constists of solving simultaneous equations with multiple unknowns.
I hope that answers the question sufficiently - my head is starting to hurt - and I think that some blah blah blah magic can happens if you do it right henceforth.
Hopefully, some better educated college kid with fresh recollection of this trig stuff enters the thread and saves my sorry old tire a$$ from looking any more foolish by picking up where I"m signing off.
NC Cams 08-07-2006, 09:39 PM Birdmanzak : I'm pretty sure that the "c" variable in your posting #16 can NOT be used that easiliy because the "c" length is is also an unknown that he's looking for in his original question.
This is why all the substituting in terms of something else are necessary to solve the problem.
birdmanzak
Your full formula looks a bit confusing to me at this stage. I find when the formula is so involved I have trouble, trouble-shooting.
I would prefer to brake down into right-angle triangles and work through it.
You have given: drop = c * arcsin(5) but C is unknown.
Is there a formula to calculate the drop using the Angle (5deg.) and B (20).
birdmanzak 08-07-2006, 10:33 PM Kiwi and NC Cams:
'c' is given by the formula in the first sketch. All the other variables are known:
'a' = circle radius = 6
'b' = distance + circle radius = 20 + 6 = 26
'A' = external angle = 5 degrees
Is there a formula to calculate the drop using the Angle (5deg.) and B (20)
Yes, but you MUST also know the circle radius.
I'd write it like this (variables in CAPITALS - only DROP is unknown):
DROP = ((0.5)* ( (2*(B+RADIUS)*(cos(ANGLE))) - sqrt( ((2*(B+RADIUS)*(cos(ANGLE)))^2) - (4*(B^2 + 2*B*RADIUS)) ))) * (arcsin(ANGLE))
There's extra whitespace to make it (slightly) more readable. Put that expression into VB (in the correct syntax, of course - I know no VB) and it'll give you your answer. Just so you know - the first part of the expression (before "*arcsin(ANGLE)") is the expression for 'c'.
edit: there were errors in here - fixed now.
Checks with Excel give:
((0.5)* ( (2*(B+RADIUS)*(cos(ANGLE))) - sqrt( ((2*(B+RADIUS)*(cos(ANGLE)))^2) - (4*(B^2 + 2*B*RADIUS)) ))) = 20.34543 (the value for 'c', confirmed by others in the thread)
and
((0.5)* ( (2*(B+RADIUS)*(cos(ANGLE))) - sqrt( ((2*(B+RADIUS)*(cos(ANGLE)))^2) - (4*(B^2 + 2*B*RADIUS)) ))) * (arcsin(ANGLE)) = 1.777735
Which should be the 'drop'.
NC Cams 08-07-2006, 10:50 PM I recognize the use of "math identities" with regard to the trig that birdmanzak is using to do his calculations. That takes me back to high school trig - AAARGH.
Thank God for Cad. If I had to rely on my knowledge of trig to survive on, I'd be starving....
birdmanzak 08-07-2006, 11:10 PM Here's an Excel spreadsheet with the function:
It's got the original sketch in it. Your use of 'B' and mine of 'b' for different things is confusing, but it works.
'b' = 'B' + RADIUS
'a' = RADIUS
Birdmanzak
Sorry for the stupid question. B is not the distance for the drop.
This is not as simple as I thought, I'll need to study in my own time...Opps Forgot, I'm self employed.
I just see your excel file arrived, I'll checkout after workhours.
NC Cams....I never learnt trig at school and thats 45yrs ago.
I also thank God for CAD because I just plug away with the trig until I get the same figures as the cad drawing shows.
birdmanzak 08-07-2006, 11:52 PM No stupid questions-
Not sure I understand the problem.
'B' is the distance from the external point to the circle.
'b' is the value I used for external point to the centre of the circle.
'DROP' is the line marked '?' in your picture "TrigFormula2.bmp" in post #12.
'c' is the line marked '?' in your picture "TrigFormula.bmp" in post #1.
If I read you right, "DROP" is the value you want, and 'c' was a necessary step to finding that. Off to work now - won't be back 'til 2am (~4am your time) so have a crack at it. I'll be able to answer any other questions tomorrow.
birdmanzak
I ment to say: b (20) length is not the horizontal distance between angle (A) Point and vertically above angle (B) Point.
I'm just confusing the issue. I should have also labeled my original drawing.
Length c is what I want. I was trying to calculate the drop, thinking this was an easier approach.
Thanks for all your help.
Birdmanzak and Others
Thankyou, up and running.
Copied your formula from the excel spread sheet and modified to suit my variables.
I then take the radius of 20 from CuspTipRadius and get the cusp height.
This is what my line look like.
CuspTipRadius = ((0.5) * ((2 * (Val(txtArcRadius.Text) + (Val(txtBallNoseDia.Text) / 2)) * (Cos(PathSegmentRad))) - Sqr(((2 * (Val(txtArcRadius.Text) + (Val(txtBallNoseDia.Text) / 2)) * (Cos(PathSegmentRad))) ^ 2) - (4 * (Val(txtArcRadius.Text) ^ 2 + 2 * Val(txtArcRadius.Text) * (Val(txtBallNoseDia.Text) / 2))))))
CuspHeight = CuspTipRadius - Val(txtArcRadius.Text)
txtCuspHeight.Text = Int(CuspHeight * 1000 + 0.5) / 1000
Pic attached to show what I'm doing.
NC Cams 08-08-2006, 08:23 AM Kiwi:
Make sure the 6R extends out as far from the tangent point between the 6R and 24R circles as you think.
We use polynomials to generate roller follower cam profiles that look/act essentially identical to what your sketch shows - but the intantaneous radius of curvature at the intersection points of your lines WON'T result in exactly what you show.
If it is a true 6R, no problem, iF not, you need to know the TRUE lift curve to find the TRUE dimension that you seek.
lakeside 08-08-2006, 11:18 AM NC Cams not only do I enjoy reading your post because I learn something. but there alway a new word that get used "...the intantaneous radius of curvature at the intersection points of your lines.." That a mouth full
NC Cams 08-08-2006, 04:05 PM You'd be amazed the instantaneous radius of curvature progression of a typical 0.430" lift roller roller race cam lobe as you go from 0 to full lift and back again in the 300 or so degrees of follower lift motion.
It would also be easier to type than it is to figure it out and then make it graphable in spreadsheet form.
NC Cams
I think your calculations for your camshaft grinding is far more important than what I am doing.
I've written a program that generates a helix tool path around a concave or convex face. When I set the step-over along the arc, using the formula it diplays the cusp height.
This is the type of path it generates.
Kiwi;
How long does it take to generate a sphere around 50 mm diameter that feels smooth. I suppose the stepover would need to be .5 mm or maybe much less for this.
NC Cams 08-08-2006, 05:14 PM That's fine - you'd better hope nobody has to grind the surface after you CNC machine it. We, you, anybody can EASILY cut a convex or concave tool path - with a small enough cutter radius, no problem whatsoever. HOWEVER, when you go to grind for a mirror smooth finish, that's when the fun/headaches start.
If/when the part "wraps" around the wheel (inverse radius), the coolant can NOT get to the instantaneous grind point. You'll IMMEDIATELY burn the part and destroy any heat treatment. Cracking is pretty much guaranteed. Go slow, go fast, you can't stop the burning.
The material turns black almost instantaneously and you end up with untempered martensite - if you're lucky Or, you get a mix of retained austenite and untempered martensite that is horrible for wear or durability. Any person who grinds cringes when someone comes in with "oh, just a small amount of inverse radii". Yeah, right....
A small dia wheel will do the grinding but you can't always get the surface footage needed to cut properly to get the finish you want/need.
Computers do amazing things with CNC cutting but they can't get past some of the physical limitations of the geometries stiff you with when it comes to dealing with hardeded metals....
tobyaxis 08-08-2006, 06:17 PM NC Cams
I think your calculations for your camshaft grinding is far more important than what I am doing.
I've written a program that generates a helix tool path around a concave or convex face. When I set the step-over along the arc, using the formula it diplays the cusp height.
This is the type of path it generates.
Kiwi,
Very impressive script for VB6. I think you started with a wireframe drawing, right? If so, do you think this script could be written for a solid model for Water Line Roughing and Finishing in BCC's Scripting?
JFettig 08-08-2006, 08:15 PM arctan(a/26)=5 solve for a
using similar triangles:
a/26=b/20 solve for b
b^2+20^2=?^2
I left my calculator at work..
Jon
Caprirs 08-09-2006, 12:42 AM See, I can do the 8th grade geometry part. But you guys started talking about programming (other than G codes) so I got lost quickly. I've never had a good knack for those sorts of programming skills unfortunately although I wish I did.
What I did was take the equation of a circle and equation for a line and find the intersection. I don't know how to get a computer to chose the right result though.
Caprirs.....I'm sorry I never grasped your method. The trouble is we are all of different levels of education and we go off on a tangent to what we know.
I believe I've come up with a High School geometry answer. Inspiration from Jon's post.
26 * Tan(5) = a2 (2.2747)
90deg - 5deg = B2 (85deg)
ASin( (2.2747 * Sin(85)) / 6) = A2 (22.1897deg)
180deg - 22.1897deg = Bdeg (157.8103deg)
180deg - (157.8103 + 5) = C (17.1897deg)
(a * Sin(17.1897)) / Sin(5) = 20.3454
Geof....
The generation of the code only takes a second once the figures are entered but the machining takes considerable time compared to a lathe.
I machined a tow ball (post #33) down from 50mm to 1.875" for a customer.
With one pass, the step-over .5mm, used a 3 tip carbide fly cutter with 3.5mm radius which took 40min. A quick rub with sandpaper and as good as the original CNC lathe job.
You wouldn't want to go into production with this method. The tow ball I machined was on a stalk with mounting lugs so this method suited.
Tobyaxis,
I do a 2D drawing of my part with the cutter shown in the start and end positions.
I then take the coords and enter them into the program.
The drawing for illustration purpose shows one side with a ball nose cutter and the other with a flycutter.
The figures for the ball nose are Start X10 Z23.34 End X31 Z-6
and Flycutter Start X20.27 Z24.75 End X34.48 Z-25.61
These figures are using the centre of the ball as 0.0. The top centre could also be used as zero.
The dark-blue line is the tool path as the cutting face moves around the cutter radius as the cutter moves down the face.
A simple program could be written so the cutter circulates at fixed levels but I believe cutting continuously give a better finish.
I'm sure a BCC script could be written. I'm not too conversant with them but VB is much better for program testing and fault finding .
JFettig 08-09-2006, 05:49 AM what I did isnt quite right, I missed the point where the side is 6" so the one side isnt actually 20", its a little longer.
JFettig 08-09-2006, 06:53 AM Corrected version:
arctan(a/26)=5 solve for a
using similar triangles by using a to solve for b
a/26=b/20 solve for b which is right side to the triangle with the one side 6
That is a similar triangle to the one with the hypotinuse 6, solve for c by using b from above
b/6=6/c solve for c with known b from above which is the right andle at that point
using the a^2+b^2=c^2 you get:
20^2+c^2=?^2
And I get 20.076396
I sketched it up in proE and got 20.35
Now I believe that is correct, you just have to run your own numbers and it should be simple.
Jon
JFettig,
It's awhile since I went to school (like 45yrs) and I don't even remember learning trig.
I'm sorry but can't follow what you have written, any chance of a diagram. Thanks for your help.
Geof....
The generation of the code only takes a second once the figures are entered but the machining takes considerable time compared to a lathe.
I machined a tow ball (post #33) down from 50mm to 1.875" for a customer.
With one pass, the step-over .5mm, used a 3 tip carbide fly cutter with 3.5mm radius which took 40min. A quick rub with sandpaper and as good as the original CNC lathe job.
You wouldn't want to go into production with this method. The tow ball I machined was on a stalk with mounting lugs so this method suited.
I agree it is not exactly production oriented but it is a good solution to an awkward problem. With a big lathe using a faceplate and some creative fixturing it might be possible to do it on a lathe and take even more time.
ajl6549 08-09-2006, 01:04 PM Hows this?
ajl6549
I have not problem drawing with a CAD program, it's the math formula that had me stumped. I use CAD to to confirm my math calculations. It is was Jon that I was asking for a drawing to go with his solution. Thanks for your input.
JFettig 08-09-2006, 05:09 PM I'm pretty sure that math was correct but the numbers just dont match up to others. I drew it up in autocad and got the same answer as others.
Basicly my math made a big triangle with one leg 26 long and the other at 5 degrees then made a similar one and a few more similar ones out of different ones.
Jon
Jon...Sounds as if your solution is a little like my post #39 but with more steps using right-angled triangles.
I've solved my problem now but what started out looking like an impossible task to me, with the help of a number of people, more then one solution has been established.
EngineerJD 08-19-2006, 01:58 PM This is another solution version with some algebra.
Janis
Janis
Thanks for your solution. Unfortunately my math is not good enough to follow your method. I can understand up to part 3 but am lost with the m and n's.
As your method gives two answers of which logic tells you which is possible, I'm not sure this method is suitable to build into a VB program.
I've since come up with simpler answer only using right-angled triangles.
Side a1 = Side b * Sin (A) := 2.26605
Side c1 = Sqr (Side a^2 - Side a1^2) :=5.5556
Side c2 = Sqr (Side b^2 - Side a1^2) :=25.9011
Side c = c2 - c1 :=20.3454
Also another formula:
SideC = SideB * Cos(A) - Sqr(SideA ^ 2 - ((SideB * Sin(A)) ^ 2)
EngineerJD 08-20-2006, 07:44 AM Hi,Kiwi.
Your latest solution seems to be as most elegant for Your task.
As I said, my version is just another solution.
About 'm' and 'n'.
That is coming from algebra handbook. There are some basic formulas ('m' and 'n' may be anyone number).
(m+n)^2=m^2+2mn+n^2
(m-n)^2=m^2-2mn+n^2
m^2-n^2=(m+n)(m-n)
Square equation in the form: mx^2+nx+c=0 (m,n,c may be anyone number) always have two values for 'x'. In concrete situation logic tell to us ('x' must to be less than 26) whitch of 'x' is valid.
Good luck.
Janis
|