rsys

Basic data structures and low-level features
git clone git://git.meso-star.fr/rsys.git
Log | Files | Refs | README | LICENSE

real2.h (1062B)


      1 /* Copyright (C) 2013-2023, 2025 Vincent Forest (vaplv@free.fr)
      2  *
      3  * The RSys library is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published
      5  * by the Free Software Foundation, either version 3 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * The RSys library is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with the RSys library. If not, see <http://www.gnu.org/licenses/>. */
     15 
     16 #ifndef REAL_TYPE__
     17   #error Missing arguments
     18 #endif
     19 
     20 /* Generate common realX funcs */
     21 #define REALX_DIMENSION__ 2
     22 #include "realX_begin.h"
     23 #include "realX.h"
     24 
     25 static FINLINE REAL_TYPE__
     26 REALX_FUNC__(cross)(const REAL_TYPE__ a[2], const REAL_TYPE__ b[2])
     27 {
     28   ASSERT(a && b);
     29   return a[0]*b[1] - a[1]*b[0];
     30 }
     31 
     32 #include "realX_end.h"