fabien van mook

all packages "fvm-*"

package "fvm-geometry"

function file "polygoninrectangle.m"

function [n,Po,u,v,lu,lv,c,Puv] = polygoninrectangle(P)

returns normal unit vector n, point Po, lateral unit
vector u, lateral unit vector v, lateral length lu, 
lateral length lv, centre c and 2-column matrix Puv,
i.e. a description of the rectangle comprising the 
polygon defined by three-dimensional points in 
3-column matrix P. 

The points in P must be in counter-clockwise ordre.
Whether this might be true, is not checked.

The counter-clockwise ordre is seen, when one sees
the "upper" or "front" surface of the polygon, i.e.
the direction of sight is oposite to the normal of
the plane of the polygon.

The lateral of the rectangle in u direction is 
parallel to the line from the first to the second 
point listed in P.

Point Po is the three-dimensional point where u=0 
and v=0.

Matrix Puv lists the u and v coordinates of the 
points listed in P.

Whether each point in P is really within the plane
through the first two points and the last point 
listed in P, is not checked!


(c) 2026 fabien van mook

2026.08.20 release of this file within package "fvm-geometry" under GNU GPLv3+