TheSwamp
CAD Forums => CAD General => Topic started by: alanjt on June 20, 2013, 09:31:21 PM
-
I'm totally blanking on how to find the height and I can't find the solution on line. Could someone much smarter than I am please tell me how?
I have two angles: 90°53'36" and 85°26'05", with a distance of 205.12'.
Thanks, guys.
-
I am not sure I understand your problem correctly but if that is a triangle with two angles and a side between them, this should work.
(defun dtr (x)
(* pi (/ x 180.000)))
(defun tan (xx)
(/ (sin xx)(cos xx)))
(setq a (- pi (dtr 90.8933333333))
b (dtr 85.434722222)
d 205.12
h (/ (* (tan b) d (tan a))(- (tan a)(tan b))))
-
Alan, We want pictures !
:)
-
Not being crazy but, given the information, could you not just draw the triangle in AutoCAD and then measure from it?
-
That's what I would have done but was thinking the OP wanted the mathematical solution.
-
Yes, I could have just done it in cad, but I couldn't remember the formula and that's what I was looking for.
BTW, thank you, Paul.
-
Alan,
Do you have Terry's routine?
;|
Here is a TRI function that I wrote last year for calculating the sides and
angles of right and oblique triangles. The function is fairly easy to use. It
has six arguments: Side s1, Side s2, Side s3, Angle a, Angle b, and Angle c.
Angles are in radians. It returns a 1 based list so you can use the ‘nth’
function to retrieve your results. To display the text help information, just
type (tri ? ? ? ? ? ?) on the command line as follows:
Note: This displays better using a courier or mono-spaced font.
Command: (tri ? ? ? ? ? ?)
tri error: (tri nil nil nil nil nil nil)
Only 2 or 3 valid arguments can be passed to tri function.
tri - Calculates the sides and angles of a triangle
Arguments: 6 |\ /\
s1 = Side s1 |a\ /a \
s2 = Side s2 | \ / \
s3 = Side s3 s2 | \ s3 s2 / \ s3
a = Angle a radians | \ / \
b = Angle b radians |c___b\ /c________b\
c = Angle c radians s1 s1
Syntax example: (tri 3 ? ? 0.643501 ? ?);where ? = nil
Returns: (list nil 3.0 4.0 5.0 0.643501 0.927295 1.5708)
Note: For right triangles only supply the argument values for 2 sides,
or 1 side and 1 angle. Use ? or nil for the Angle c argument value.
For oblique triangles only supply argument values for 3 sides,
or 2 sides and 1 angle, or 1 side and 2 angles.
|;
;-------------------------------------------------------------------------------
; tri - Calculates the sides and angles of a triangle
; Arguments: 6 | /\
; s1 = Side s1 |\ /a \
; s2 = Side s2 |a\ / \
; s3 = Side s3 s2 | \ s3 s2 / \ s3
; a = Angle a radians | \ / \
; b = Angle b radians |c__b\ /c________b\
; c = Angle c radians s1 s1
; Syntax example: (tri 3 ? ? 0.643501 ? ?);where ? = nil
; Returns: (list nil 3.0 4.0 5.0 0.643501 0.927295 1.5708);nth 1 based list
; Note: For right triangles only supply the argument values for 2 sides, or
; 1 side and 1 angle. Use ? or nil for the Angle c argument value. For oblique
; triangles only supply argument values for 3 sides, or 2 sides and 1 angle,
; or 1 side and 2 angles.
; Programming example usages:
; (setq Side2 (nth 2 (tri 3 ? ? 0.643501 ? ?))) = 4.0
; (setq AngleB (nth 5 (tri 3 ? ? 0.643501 ? ?))) = 0.927295
-
Alan,
Do you have Terry's routine?
;|
Here is a TRI function that I wrote last year for calculating the sides and
angles of right and oblique triangles. The function is fairly easy to use. It
has six arguments: Side s1, Side s2, Side s3, Angle a, Angle b, and Angle c.
Angles are in radians. It returns a 1 based list so you can use the ‘nth’
function to retrieve your results. To display the text help information, just
type (tri ? ? ? ? ? ?) on the command line as follows:
Note: This displays better using a courier or mono-spaced font.
Command: (tri ? ? ? ? ? ?)
tri error: (tri nil nil nil nil nil nil)
Only 2 or 3 valid arguments can be passed to tri function.
tri - Calculates the sides and angles of a triangle
Arguments: 6 |\ /\
s1 = Side s1 |a\ /a \
s2 = Side s2 | \ / \
s3 = Side s3 s2 | \ s3 s2 / \ s3
a = Angle a radians | \ / \
b = Angle b radians |c___b\ /c________b\
c = Angle c radians s1 s1
Syntax example: (tri 3 ? ? 0.643501 ? ?);where ? = nil
Returns: (list nil 3.0 4.0 5.0 0.643501 0.927295 1.5708)
Note: For right triangles only supply the argument values for 2 sides,
or 1 side and 1 angle. Use ? or nil for the Angle c argument value.
For oblique triangles only supply argument values for 3 sides,
or 2 sides and 1 angle, or 1 side and 2 angles.
|;
;-------------------------------------------------------------------------------
; tri - Calculates the sides and angles of a triangle
; Arguments: 6 | /\
; s1 = Side s1 |\ /a \
; s2 = Side s2 |a\ / \
; s3 = Side s3 s2 | \ s3 s2 / \ s3
; a = Angle a radians | \ / \
; b = Angle b radians |c__b\ /c________b\
; c = Angle c radians s1 s1
; Syntax example: (tri 3 ? ? 0.643501 ? ?);where ? = nil
; Returns: (list nil 3.0 4.0 5.0 0.643501 0.927295 1.5708);nth 1 based list
; Note: For right triangles only supply the argument values for 2 sides, or
; 1 side and 1 angle. Use ? or nil for the Angle c argument value. For oblique
; triangles only supply argument values for 3 sides, or 2 sides and 1 angle,
; or 1 side and 2 angles.
; Programming example usages:
; (setq Side2 (nth 2 (tri 3 ? ? 0.643501 ? ?))) = 4.0
; (setq AngleB (nth 5 (tri 3 ? ? 0.643501 ? ?))) = 0.927295
I do not, but that looks rather impressive.
-
Alan, in case you didn't google it, here is link :
http://www.theswamp.org/index.php?topic=15698.msg191722#msg191722
-
Yes, I could have just done it in cad, but I couldn't remember the formula and that's what I was looking for.
BTW, thank you, Paul.
You are welcome.
Here is how I came to the formula (attached). No Google.
-
Thanks for the link, I was missing that. 8)
Alan, in case you didn't google it, here is link :
http://www.theswamp.org/index.php?topic=15698.msg191722#msg191722 (http://www.theswamp.org/index.php?topic=15698.msg191722#msg191722)
-
I am not sure I understand your problem correctly but if that is a triangle with two angles and a side between them, this should work.
(defun dtr (x)
(* pi (/ x 180.000)))
(defun tan (xx)
(/ (sin xx)(cos xx)))
(setq a (- pi (dtr 90.8933333333))
b (dtr 85.434722222)
d 205.12
h (/ (* (tan b) d (tan a))(- (tan a)(tan b))))
Sorry, I think the height in your code should be:
(setq h (/ (* (tan b) d (tan a)) (+ (tan a) (tan b))))
-
I disagree
-
I disagree
Have you tried what Alan given and drawn it in AutoCAD?
Angle 1 = 90.8933333333 deg
Angle 2 = 85.434722222 deg
Distance = 205.12
What would you get for the height?
Would it be the same as what you calculated from your code?
Thanks.
-
Yes, I did draw it and measured to verify my code result. See the attached drawing in my second post here.
-
Your correction would work only if both angles were less than 90 deg.
-
Your correction would work only if both angles were less than 90 deg.
Not really. It works for angles greater than 90deg as well.
From your code the height = 3192.2655
while the height measured on the drawing = 2149.1800, which is based on these:
Angle a = 90.8933333333 deg
Angle b = 85.434722222 deg
Distance = 205.12
-
I think you guys need to go back and define your terms.
The decision to add or subtract the divisor components depends on the way the larger angle is measured.
You are using different criteria.
-
For instance :
using the internal angles as per the sketch attached is correct.
Using (- pi (dtr 100)) as Paul has done requires the divisor components be negated (as he has done).
So you are both correct, or both incorrect or whatever
-
In answer to a PM.
The app is 'Pencil' ..
http://pencil.evolus.vn/Features.html
-
Thanks to Kerry's explanations.
OK, lets go back to the starting point.
I don't know if Alan has already looked Paul's drawing.
I know that is not easy when translating the words to the drawing.
Generally speaking, our discussions should be all based on the same coordinate system, which means that all angles measured anticlockwise from X axis.
By looking at your drawing, the angle "A" you described actually differs to what Alan given.
Alan's: 90°53'36"
and yours: 180° - 90°53'36" = 89°06'24"
This explains why you got the height of 3192.2655
In other words, the angle "A" in your code can be simplified to:
(setq a (dtr 90.8933333333))
I attache my version here. Hope I have not misunderstood Alan's issue.
-
MeasureUp,
Your triangles are acute ;
Pauls is obtuse
I guess this whole thread is a perfect example of one of my favourite topics .. making sure we are all answering the correct question.
added:
For what it's worth, my assumptions about the problem were the same as Pauls ie the angles given represented the internal triangle angles.
-
MeasureUp,
Your triangles are acute ;
Pauls is obtuse
I guess this whole thread is a perfect example of one of my favourite topics .. making sure we are all answering the correct question.
Thanks Kerry, again.
We shall now wait and see what Alan will say. :-D
Of course, Paul can check if I haven't miss any points from you.
-
As Kerry is saying, your triangle is acute. But, Alan specified one angle acute and the other obtuse.
-
Strange, I would always assumed we were talking Internal Angles with a triangle.
Other wise the orientation of the triangle comes into play. :o
-
Strange, I would always assumed we were talking Internal Angles with a triangle.
<fake southern drawl>That's the way I was learnt to do it.
-
By looking at Paul's drawing again, lets think in this way, we now draw 2 construction lines.
One to the angle of 90.8933333333deg and another to 85.434722222deg.
If the 1st one placed on left while the 2nd on the right, we all know that they never intersect physically.
This is what the info was given by Alan.
It only makes sense if the 1st construction line drawn on the right.
Agree?
If we have a building/civil/survey background, we may better understand the info which Alan's given.
Hope I have explained what I think clearly.