fabien van mook

all packages "fvm-*"

package "fvm-geometry"

function file "smallsquare.m"

Function P = smallsquare(p,u,v,s,o)
         P = smallsquare(p,P0,s,o)

returns a polygon P representing a small square with side 
length s, drawn around the given point p. One side is along
vector u, the other along vector u. Instead of input of u and
v directly, a polygon P0 may be given, from which is calculated:
  u = P0(2,:)   - P0(1,:),
  v = P0(end,:) - P0(1,:).
For nonzero values of o, the returned polygon P is offsetted
with distance o from point p perpendicularily to the plane
defined by u and v. 

Input variables p, u and v are arrays of 1 row and 3 columns.
Input variable P0 has at least 3 rows, and has 3 columns.
Output variable P has 4 rows and 3 columns. 

The validity of the input is not checked!


(c) 2026 fabien van mook

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