Post Reply 
University of Houston math contests
07-12-2019, 10:34 AM (This post was last modified: 07-12-2019 12:09 PM by Albert Chan.)
Post: #5
RE: University of Houston math contests
(07-11-2019 08:26 PM)John Keith Wrote:  It's already done for you. Smile

https://www.hpmuseum.org/forum/thread-11...t=shoelace

For quadrilateral, we could reduce ops with a more compact formula.

Area = ½|(x3-x1)(y4-y2) - (x4-x2)(y3-y1)|

This reduce Shoelace 9 multiply and 8 add/sub to just 3 multiply and 5 subtract.

We could also use this formula for triangle area, by letting {x4,y4} = {x3,y3}

Example, with XCas:

area4(a,b,c,d) := 0.5*abs(det([c-a,d-b]))
area3(a,b,c) := area4(a,b,c,c)

a,b,c,d := [-6.94,-1.2], [-5.16, 3.84], [3.4,2.18], [2.46,-6.72]

area4(a,b,c,d) → 67.473
area3(a,b,c) + area3(a,c,d) → 23.0486 + 44.4244 = 67.473
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: University of Houston math contests - Albert Chan - 07-12-2019 10:34 AM



User(s) browsing this thread: 4 Guest(s)