Solved

Finding third cordinates of a triangle

Posted on 2001-09-17
13
868 Views
Last Modified: 2011-11-28
I have a right angle triangle and I know two cordinates and the length of all thres sides. I need to find the third cordiante in VB. e.g. I have (0,0) and (3,0) and lengths as 3 (for base), 4 (for perp), 5 for (hypoteneous). How to find third cordinate in VB?

Help Req.
0
Comment
Question by:aqk139
  • 4
  • 3
  • 2
  • +4
13 Comments
 
LVL 3

Expert Comment

by:TheRedGuy
ID: 6487336
Sound like homeworkj to me! Look up Pythagoras Theorem!
0
 
LVL 15

Expert Comment

by:cquinn
ID: 6487358
for a 3,4,5 triangle the coordinates would be:

0,0
3,0
0,4


 0,4
 | \
 |  \
 |___\
0,0   3,0

0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 6487375
You would need to use that standard Trig functions:

Sin(angle) = Side opposite/hypotenuse
Cos(Angle) = side adjacent/hypotenuse

you can also use the Pythogorean theorem:

   H^2 = A^2 + B^2

However, this IS NOT a VB question, but rather a basic question about Trigonometry and Algebra.
0
 
LVL 2

Expert Comment

by:YourBuddyToo
ID: 6487407
Pythogrean's theorem only works on right triangles.  The question at hand is not necessarily limited to right triangles.
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 6487435
YourBuddyToo:

If you take the time to read the original question, He/She states EXPLICITLY that they are working with RIGHT TRIANGLES.
0
 
LVL 2

Expert Comment

by:YourBuddyToo
ID: 6487456
The solution looks something like this:

Let A be the left side of the triangle, B be the base of the trinangle, C the right Side.  ThetaA the angle between side A and side B, ThetaB the angle between side B and side C.

First, the A + C must be > B (or it won't form a triangle, the sides are too short.

Next

B = A Cos(ThetaA) + C Cos(ThetaB)
A Sin(ThetaA) = C Sin(ThetaB)

You now have two equations w/ two unknowns (ThetaA & ThetaB).  Solve for ThetaA & ThetaB

But wait, we are not done yet, we need to calculate the coordinates for that point.  If we assume the base is horizontal (if not, we need to do some more trig), we can calculate the offsets from the intersection of sides A & B by:

DeltaX = A Cos(ThetaA)
DeltaY = +/- A Sin(ThetaA)  (two solutions, one where the point is above line B, one where it is below line B)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:YourBuddyToo
ID: 6487470
Thanks Arthur, leave it to an engineer to make a question harder than it needs to be.  For right triangles, the answer is easier.

The Y cord is the length of A,  X cord is either 0 (the x position of the intersection of A & B) or B (the intersection of B & C).
0
 

Author Comment

by:aqk139
ID: 6488025
I think u all r confuse due to my example. I need a general function that give me the third cordinate of a trinangle by giving that function all three length of triangle and two cordinates. The triangle my be at any angle with x-axis or y-axis.


Clear.
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 6488054
are you ALWAYS dfealing with right triangles?
0
 
LVL 2

Expert Comment

by:YourBuddyToo
ID: 6488077
And if so, is the 90? angle on the left or the right side of the base.  Note that the equaitons I gave above work for any triangle (including right triangles).  It did not include any angle for the base itself (which appears to be part of the quesiton now).

For a base that could be at an angle,

ThetaBase = Atn((BaseYRight - BaseYLeft) / (BaseXRight - BaseXLeft)

XCoord = A Cos(ThetaA) + B Cos(ThetaBase) + BaseXLeft
YCoord = +/- A Sin(ThetaA) + B Sin(ThetaBase) + BaseYLeft

0
 
LVL 6

Accepted Solution

by:
andyclap earned 40 total points
ID: 6490777
>I need a general function that give me the third cordinate of a trinangle by giving that function all three length of triangle and two cordinates.

Unfortunately you cannot have one. There are two possible answers to this problem: Think about a mirror image of the triangle, flipped along the side defined by the two points you have - you cannot know which of the two answers is correct.

So, how would you like a general function which takes two coordinates and three lengths, and returns two sets of two coordinates represenging the two possible answers? Or do you have any extra information which would help you determine which of the two possible positions for the third point you want.
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6767174
There has been no activity in this question in quite some time, and it looks like it has been abandoned. As part of our ongoing mission to clean up the topic areas, a Moderator will finalize this question within the next seven (7) days. At that time, either I or one of the other Moderators will force/accept the comment of andyclap.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER. If you have further comments on this question or the recommendation, please leave them here.

aqk139,

Some of these questions have been open for some time, and records indicate you logged in as recently as last week. Please resolve them appropriately as soon as possible. Continued disregard of your open questions will result in the force/acceptance of a comment as an answer; other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days.

http://www.experts-exchange.com/jsp/qShow.jsp?ta=msaccess&qid=20202508
http://www.experts-exchange.com/jsp/qShow.jsp?ta=crystal&qid=20255526
http://www.experts-exchange.com/jsp/qShow.jsp?ta=oracle&qid=20167212
http://www.experts-exchange.com/jsp/qShow.jsp?ta=oracle&qid=20165928
http://www.experts-exchange.com/jsp/qShow.jsp?ta=oracle&qid=20141926
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20243322
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20207867
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20207526
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20191215
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20183720
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20180355
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20175537
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20175003

Thanks,

Netminder
Community Support Moderator
Experts Exchange
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6821378
Admin notified of user neglect. Force/accepted by

Netminder
Community Support Moderator
Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA open file from excel cell 4 36
how can i unlock a picture file that was loaded in a picturebox in visual c#? 4 88
Adding to a VBA? 6 63
VB6 ListBox Question 4 34
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now