Skip to content

Feature map ​

Every feature of VecFor, where the tutorial teaches it, where the cookbook shows it and where the reference describes it.

FeatureHowTutorialCookbookReference
The vector typetype(vector), components x, y, z1componentsThe vector type
Versorsex, ey, ez1componentsVersors
Structure constructorvector(x, y, z)1componentsBuilding a vector
Assignment of a numberv = 2.5_R8P, any integer or real kind1one numberAssignment
Sum, difference, signa + b, a - b, -a, +a2sumArithmetic
Scalings * a, a * s, a / s, any kind2scalingArithmetic
A number on every componenta + s, s + a, a - s, s - a2plus a numberArithmetic
Component-wise product, quotienta * b, a / b2component-wiseArithmetic
Dot producta .dot. b3productsProducts
Cross producta .cross. b3productsProducts
Accurate productscrossproduct_accurate, dotproduct_accurate3accurateAccurate products
LengthnormL2, sq_norm3lengthLengths and directions
Unit vectornormalized, normalize3unit vectorLengths and directions
Checked normalizationnormalized_checked, ok, min_norm3checked unit vectorLengths and directions
Angleangle3angleAngle
Methods or free functionsa%normL2() or normL2(a)3two spellingsNames
Parallel and orthogonal componentsa .paral. n, a .ortho. n6componentsProducts
Comparisons==, /=, <, <=, >, >=, with vectors and numbers8vectors, numbersComparisons
Face normals and areasface_normal3, face_normal4, norm4triangle, quadrilateralFace normals
Cell measurestriangle_area, tetrahedron_volume, polygon_vector_area4area, volumeMeasures
Distance from a linedistance_to_line5lineDistances
Distance from a planedistance_to_plane, distance_vectorial_to_plane5planeDistances
Projection onto a planeprojection_onto_plane5planeDistances
Point locationbarycentric_triangle, barycentric_tetrahedron, closest_point_triangle5inside, closest pointPoint location
Collinear pointsis_collinear, tolerance5collinearPredicates
Concyclic pointsis_concyclic, tolerance5concyclicPredicates
Rotationrotate(axis=, angle=), rotate(matrix=), rotation_matrix7axis, matrixRotations
Mirrormirror(normal=), mirror(matrix=), mirror_matrix7plane, matrixMirrors
Matrix times vectorm .matrix. a7any matrixProducts
Arrays of vectorselemental operators and functions, p%x8arraysArrays
Precisionsvector_R4P, vector_R8P, vector_R16P, versors and functions of each9each precisionPrecision and kinds
True quadruple precision-DPENF_R16P9quadrupleQuadruple
Default kindvector, ex, ..., -DDEFKIND_R4P, -DDEFKIND_R16PThe default kind
Printingprintf(prefix=, sep=, suffix=, unit=)10printingprintf
Filessave_into_file, load_from_file, fmt, pos10binary, text, streamFiles
Record lengthiolen10direct accessiolen
I/O errorsiostat, iomsg10errorsErrors
Device-callable routines*_dev, 38 for each kind11deviceDevice-callable API

Not available: vectors of other dimensions than three; operations between vectors of two different kinds; sum, dot_product or matmul of the intrinsics on vectors; a tolerance in the comparisons (see Behaviour and limitations).

Released under the GPL v3, BSD 2-Clause, BSD 3-Clause or MIT License.