POV-Ray : Newsgroups : povray.newusers : Mesh and polygons area : Re: Mesh and polygons area Server Time
28 Jul 2024 18:15:57 EDT (-0400)
  Re: Mesh and polygons area  
From: alphaQuad
Date: 3 Nov 2007 01:20:01
Message: <web.472c11c0881ace7c3bb21de50@news.povray.org>
"alphaQuad" <alp### [at] earthlinknet> wrote:

> The Volume of pyramid is [area of the pyramid's base] X [height] X
> [1/3], and is expressed in cubic units.
> from: [http://www.aaamath.com/B/geo79_x6.htm]

also given 4 3d points, volume of the tetrahedron =


This can be rewritten as a dot and cross product, yielding

    V = \frac { |(\mathbf{d}-\mathbf{a}) \cdot
((\mathbf{d}-\mathbf{b}) \times (\mathbf{d}-\mathbf{c}))| } {6}.
http://en.wikipedia.org/wiki/Tetrahedron


OMG LOL!!!!!!!

tested
alias pyramid_area {
  ; (4 3d pnts)
  return $calc($abs($dotprod($subv($4,$1), $&
         $cross($subv($4,$2), $subv($4,$3)))) / 6)
}


POV
#macro pyramid_area(A,B,C,D)
  vdot(D-A,vcross(D-B,D-C)) / 6
#end


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.