LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I calculate the area of a triangle on an XY graph?

 

If I know the X,Y points of the three points of a triangle how do i calculate the area of the triangle?

 

Thanks

Tim C.

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 1 of 8
(5,629 Views)

Hi Tim,

 

have you tried to use standard geometry functions to calc the size of a simple triangle? Wikipedia has several of them...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(5,620 Views)

Tim,

 

Three points, A, B, and C, that define a triangle can be substituted with two vectors, (A->B) and (A->C).  The area of the triangle is half the magnitude of the cross-product of these two vectors.  The attached VI calculates this.

 

Chris M

Message 3 of 8
(5,618 Views)

Can you back save the example to LV 8.5 please.

 

Thanks in Advance

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 4 of 8
(5,588 Views)

Here it is saved in LabVIEW 8.5.

 

Chris M

0 Kudos
Message 5 of 8
(5,584 Views)

Do I enter two vales in each array control that represent the X and Y coordinates?

 

A X-0, Y-8.64

B X-0, Y-8.69

C X- 0.23, Y-8.68

 

Area = .00575

 

My understanding is that the area is unitless at his point, but if each Y value represented a dollar value and the Point C X value represents where a price move and a math function of that same price move (ie a expontential moving average)  cross (price going up, expontial average going down) How can I think of the area in terms of a unit?

 

Thanks

Tim C.

 

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 6 of 8
(5,582 Views)

Tim,

 

Yes, the first two values in each array represent the X and Y coordinates, respectively.  This VI is meant only as an example to help you undersand how to calculate the area, so make sure you understand what it is doing.

 

I am not sure I understand your explanation of the X and Y units, so I cannot comment on what the units of area should be, but that should be determined by the purpose of your application.  In other words, why are you trying to calculate the area if you do not know the units of area?

 

Chris M 

0 Kudos
Message 7 of 8
(5,572 Views)

My goal of calculating the area of the triangle is simply to see if a certain amount of area in the triangle formmed when a stock closing price headed up from the previous day close crosses the expontentail downward moving average is a good indicator as to how much the stock moves the next day.

 

I guess I will expiriment and see if some area values turn out to be a good indicator, and if so maybe call it market pressure 🙂

 

Thanks For Your Help

Tim C.

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 8 of 8
(5,561 Views)