.TH "point" 2rheolef "Version 7.2" "rheolef" \" -*- nroff -*- .ad l .nh .SH NAME point \- d-dimensional physical point or vector (rheolef-7\&.2) .SH "DESCRIPTION" .PP The \fCpoint\fP defines a vertex or vector in the physical d-dimensional space, d=1,2,3\&. It is represented as an array of coordinates\&. The coordinate index starts at zero and finishes at \fCd-1\fP, e\&.g\&. \fCx[0]\fP, \fCx[1]\fP and \fCx[2]\fP\&. .PP The default constructor set all components to zero: .PP .nf point x; .fi .PP and this default could be overridden: .PP .nf point x (1, 2, 3\&.14); .fi .PP or alternatively: .PP .nf point x = {1, 2, 3\&.14}; .fi .PP The standard linear algebra for vectors is supported by the \fCpoint\fP class\&. .SH "IMPLEMENTATION" .PP This documentation has been generated from file fem/geo_element/point\&.h .PP The \fCpoint\fP class is simply an alias to the \fC\fBpoint_basic\fP\fP class .PP .PP .nf typedef point_basic point; .fi .PP .PP The \fC\fBpoint_basic\fP\fP class is a template class with the floating type as parameter: .PP .PP .nf template class point_basic { public: // typedefs: typedef size_t size_type; typedef T element_type; typedef T scalar_type; typedef T float_type; // allocators: explicit point_basic(); explicit point_basic (const T& x0, const T& x1 = 0, const T& x2 = 0); template point_basic(const point_basic& p); template point_basic& operator= (const point_basic& p); point_basic (const std::initializer_list& il); // accessors: T& operator[](int i_coord) { return _x[i_coord%3]; } T& operator()(int i_coord) { return _x[i_coord%3]; } const T& operator[](int i_coord) const { return _x[i_coord%3]; } const T& operator()(int i_coord) const { return _x[i_coord%3]; } // algebra: bool operator== (const point_basic& v) const; bool operator!= (const point_basic& v) const; point_basic operator+ (const point_basic& v) const; point_basic operator\- (const point_basic& v) const; point_basic operator\- () const; point_basic& operator+= (const point_basic& v); point_basic& operator\-= (const point_basic& v); point_basic& operator*= (const T& a); point_basic& operator/= (const T& a); template typename std::enable_if< details::is_rheolef_arithmetic::value ,point_basic >::type operator* (const U& a) const; point_basic operator/ (const T& a) const; point_basic operator/ (point_basic v) const; // i/o: std::istream& get (std::istream& s, int d = 3); std::ostream& put (std::ostream& s, int d = 3) const; .fi .PP .PP .nf }; .fi .PP .PP \fB\fP .RS 4 .RE .PP These linear and nonlinear functions are completed by some usual functions: .PP .PP .nf template std::istream& operator >> (std::istream& s, point_basic& p); template std::ostream& operator << (std::ostream& s, const point_basic& p); template typename std::enable_if< details::is_rheolef_arithmetic::value ,point_basic >::type operator* (const U& a, const point_basic& u); template point_basic vect (const point_basic& v, const point_basic& w); // metrics: template T dot (const point_basic& x, const point_basic& y); template T norm2 (const point_basic& x); template T norm (const point_basic& x); template T dist2 (const point_basic& x, const point_basic& y); template T dist (const point_basic& x, const point_basic& y); template T dist_infty (const point_basic& x, const point_basic& y); template T vect2d (const point_basic& v, const point_basic& w); template T mixt (const point_basic& u, const point_basic& v, const point_basic& w); // robust(exact) floating point predicates: return the sign of the value as (0, > 0, < 0) // formally: orient2d(a,b,x) = vect2d(a\-x,b\-x) template int sign_orient2d ( const point_basic& a, const point_basic& b, const point_basic& c); template int sign_orient3d ( const point_basic& a, const point_basic& b, const point_basic& c, const point_basic& d); // compute also the value: template T orient2d( const point_basic& a, const point_basic& b, const point_basic& c); // formally: orient3d(a,b,c,x) = mixt3d(a\-x,b\-x,c\-x) template T orient3d( const point_basic& a, const point_basic& b, const point_basic& c, const point_basic& d); template std::string ptos (const point_basic& x, int d = 3); // ccomparators: lexicographic order template bool lexicographically_less (const point_basic& a, const point_basic& b); .fi .PP .SH AUTHOR Pierre Saramito .SH COPYRIGHT Copyright (C) 2000-2018 Pierre Saramito GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.