04-27-2009 03:24 PM
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.
04-27-2009 03:44 PM
Hi Tim,
have you tried to use standard geometry functions to calc the size of a simple triangle? Wikipedia has several of them...
04-27-2009 03:47 PM
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
04-27-2009 05:41 PM
Can you back save the example to LV 8.5 please.
Thanks in Advance
04-27-2009 05:46 PM
Here it is saved in LabVIEW 8.5.
Chris M
04-27-2009 05:59 PM
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.
04-27-2009 06:33 PM
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
04-27-2009 06:49 PM
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.