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
LengthnormL2, sq_norm3lengthLengths and directions
Unit vectornormalized, normalize3unit vectorLengths and directions
Angleangle3angleAngle
Parallel and orthogonal componentsa .paral. n, a .ortho. n6componentsProducts
Face normals and areasface_normal3, face_normal4, norm4triangle, quadrilateralFace normals
Distance from a linedistance_to_line5lineDistances
Distance from a planedistance_to_plane, distance_vectorial_to_plane5planeDistances
Projection onto a planeprojection_onto_plane5planeDistances
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
Comparisons==, /=, <, <=, >, >=, with vectors and numbers8vectors, numbersComparisons
Arrays of vectorselemental operators and functions, p%x8arraysArrays
Methods or free functionsa%normL2() or normL2(a)3two spellingsNames
Precisionsvector_R4P, vector_R8P, vector_R16P, versors and functions of each9each precisionPrecision and kinds
True quadruple precision-DPENF_R16P9quadrupleQuadruple
Printingprintf(prefix=, sep=, suffix=, unit=)10printingprintf
Filessave_into_file, load_from_file, fmt, pos10binary, text, streamFiles
Record lengthiolen10direct accessiolen
I/O errorsiostat, iomsg10errorsErrors
OpenACC device routines*_oac11deviceDevice-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.