Jump to content

Recommended Posts

Posted

Hi everyone,

 

I was trying to solve a right triangle earlier, But I found some problems that developed which I think was due to precision. I gave up on that thought and am now trying to solve this problem as shown below using an Isosceles Triangle.

 

I found a formula for this which looked easy, But gave me odd results.

I am not sure if I am using it correctly.

 

Can someone please explain this formula?

eqnaltitude.JPG

Document1.JPG

Posted

Buzzard,

 

You would use Pythagoras Thm, think of the triangle as two right angled triangles and solve for the side you need :)

 

Pythagoras: a^2 = b^2 + c^2

 

Here, 'L' is the hypotenuse, 'A' is one side, and '(B/2)' is the other, hence:

 

L^2 = A^2 + (B/2)^2        ==>        A^2 = L^2 - (B/2)^2

Posted
(defun test (b c)
 (sqrt (- (* c c) (* b b))))

Posted

Thanks Lee,

 

I am trying to find the length of A. The formula you are showing in my case would be written like this? a^2 = b^2 + L^2

 

Just trying to confirm this since I have been seeing many different letters used and it gets confusing.

Posted

Hi Buzzard, check my post - it should show an example, I edited it :)

Posted
(defun test (b c)
 (sqrt (- (* c c) (* (/ b 2.) (/ b 2.)))))

Posted

When you refer to the value of B, Is that 7.6916^2 or 15.3832^2.

 

Either way I calculate it, It comes out very large.

I would think the answer should be 15.3814.

Posted
(defun test (b c)
 (sqrt (- (* c c) (* (/ b 2.) (/ b 2.)))))

alanjt,

 

What is the period after the 2 for?

Posted
alanjt,

 

What is the period after the 2 for?

Do divide with a real number, instead of an integer.

Posted
When you refer to the value of B, Is that 7.6916^2 or 15.3832^2.

 

Either way I calculate it, It comes out very large.

I would think the answer should be 15.3814.

 

I assume that you are labelling 'B' as the base of the Isosceles triangle, so the side of each right angled triangle would be B/2

 

The calculation would be:

 

A^2  =  L^2    -    (B/2)^2

A^2  =  17.1973^2  -  7.6916^2

Therefore:

A  =  sqrt ( 236.586 )  =  15.3814  (4 d.p)

Posted

alanjt,

 

Close, But no cigar. It returns 16.7618 when it should be 15.3814.

I am not sure what I am doing wrong here?

Posted
I assume that you are labelling 'B' as the base of the Isosceles triangle, so the side of each right angled triangle would be B/2

 

The calculation would be:

 

A^2  =  L^2    -    (B/2)^2

A^2  =  17.1973^2  -  7.6916^2

Therefore:

A  =  sqrt ( 236.586 )  =  15.3814  (4 d.p)

Ok Lee,

 

Now I got it. The answer returned was squared.

Posted

Ok, I think I have this figured out.

 

I will need to rewrite my function differently now.

 

Thanks to the both of you guys.

Posted

Lee & Alan,

 

I just rewritten my function with the new calculations and it is on the money.

I sort of combined Lee's formula with Alan's approach and it works great.

 

Thanks again for the brain loaner.

The Buzzard

Posted
alanjt,

 

Close, But no cigar. It returns 16.7618 when it should be 15.3814.

I am not sure what I am doing wrong here?

How'd you get 16.7618?

Both equations work on my end:

 

(defun test (b c)
 (sqrt (- (* c c) (* b b))))

Result:

Command: (test 7.6916 17.1973)
15.3814

 

 

(defun test (b c)
 (sqrt (- (* c c) (* (/ b 2.) (/ b 2.)))))

 

Result:

Command: (test (* 2. 7.6916) 17.1973)
15.3814

 

I just multiplied the 7.6919 by 2.0 since I the original formula was taking half of b. However, of the two, I'd choose the former.

 

I still can't figure out how you didn't get the correct result. These are written as a proper Pythagorean (just solved for a).

Posted
How'd you get 16.7618?

Both equations work on my end:

 

(defun test (b c)
 (sqrt (- (* c c) (* b b))))

Result:

Command: (test 7.6916 17.1973)
15.3814

 

 

(defun test (b c)
 (sqrt (- (* c c) (* (/ b 2.) (/ b 2.)))))

 

Result:

Command: (test (* 2. 7.6916) 17.1973)
15.3814

 

I just multiplied the 7.6919 by 2.0 since I the original formula was taking half of b. However, of the two, I'd choose the former.

 

I still can't figure out how you didn't get the correct result. These are written as a proper Pythagorean (just solved for a).

I think the symbols that I was using were responsible for the error. I may have gotten some mixed up some place. The program is now functioning well although I ran into some problems with getting bulge factor angles to be consistent. I made a temporary fix here till I can get the rest of the program completed. I will be posting the complete program soon and you will see what I did. Its a bit difficult for me to explain at this point. This has nothing really to do with these calculations that were provided here as they work very well. I just need to break things down a little different since the coordinate points I set up had to go a certain way and I mixed an option with toggle buttons to get a desired result. Should be a nice code when its done.

 

Again, Thanks for the help on this,

It worked out real well.

The Buzzard

Posted
I think the symbols that I was using were responsible for the error. I may have gotten some mixed up some place. The program is now functioning well although I ran into some problems with getting bulge factor angles to be consistent. I made a temporary fix here till I can get the rest of the program completed. I will be posting the complete program soon and you will see what I did. Its a bit difficult for me to explain at this point. This has nothing really to do with these calculations that were provided here as they work very well. I just need to break things down a little different since the coordinate points I set up had to go a certain way and I mixed an option with toggle buttons to get a desired result. Should be a nice code when its done.

 

Again, Thanks for the help on this,

It worked out real well.

The Buzzard

 

Glad you worked it out. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...