Re: Solving Triangles
- From: Stan Weiss <srweiss@xxxxxxxxx>
- Date: Sat, 28 Jan 2006 10:35:35 -0500
Triangulation. If I know the length of one side and the angle at each
end plus each ends x, and y axis how can I find the x and y axis for the
third point?
Thanks,
Stan
Steve Gerrard wrote:
>
> "Desertphile" <desertphile@xxxxxxxxxxx> wrote in message
> news:1138418352.721519.98700@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > Rick Rothstein [MVP - Visual Basic] wrote:
> >
> >> To get the rest of the angles, use the Law of Sines...
> >>
> >> a / Sin(A) = b / Sin(B) = c / Sin(C)
> >>
> >> To get the missing side, use the Cosine Law...
> >>
> >> a ^ 2 = b ^ 2 + c ^ 2 - 2 * b * c * Cos(A)
> >
> > Greetings. I know the above (thank you). My question was on how to do
> > this. I have at least 20 pages with the above (and similar) formulas,
> > but I do not know how to convert the formulars into Visual BASIC code.
> >
> > I herd sheep for a living; I ain't what one would call well-educated.
> > :-)
> >
>
> Better than herding cats, which is what some jobs are like :)
>
> You have to do the algebra, as well as the trig, and also lookup the "derived
> math function" for ArcSin.
>
> Try this:
>
> Private Sub Command1_Click()
> Call CalcSAS(6, 15, 3)
> End Sub
>
> Private Sub CalcSAS(ByVal SideB As Double, _
> ByVal AngA As Double, ByVal SideC As Double)
>
> Const PI As Double = 3.14159265358979
> Dim SideA As Double
> Dim AngB As Double
> Dim AngC As Double
> Dim RadianA As Double
> Dim Temp As Double
>
> ' angle to radians
> RadianA = AngA / 180 * PI
>
> ' SideA from Law of Cosines
> Temp = 2 * SideB * SideC * Cos(RadianA)
> SideA = Sqr(SideB ^ 2 + SideC ^ 2 - Temp)
>
> ' AngleB from Law of Sines
> Temp = ArcSin(SideB / SideA * Sin(RadianA))
> AngB = 180 / PI * Temp
>
> ' AngleC by definition
> AngC = 180 - AngA - AngB
>
> Debug.Print "Sides:", SideA, SideB, SideC
> Debug.Print "Angles:", AngA, AngB, AngC
>
> End Sub
>
> Private Function ArcSin(ByVal X As Double) As Double
> ArcSin = Atn(X / Sqr(1 - X ^ 2))
> End Function
.
- Follow-Ups:
- Re: Solving Triangles
- From: Steve Gerrard
- Re: Solving Triangles
- References:
- Solving Triangles
- From: Desertphile
- Re: Solving Triangles
- From: Rick Rothstein [MVP - Visual Basic]
- Re: Solving Triangles
- From: Desertphile
- Re: Solving Triangles
- From: Steve Gerrard
- Solving Triangles
- Prev by Date: Re: Solving Triangles
- Next by Date: Re: A Question about list boxes.
- Previous by thread: Re: Solving Triangles
- Next by thread: Re: Solving Triangles
- Index(es):
Relevant Pages
|