blob: fb562161a629c7b8b07d4b024e33050dba8518ec [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/* (X,Y) coordinates. */
2
3/*
4 Copyright (c) 2008 Eliot Dresselhaus
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24*/
25
26#ifndef included_clib_xy_h
27#define included_clib_xy_h
28
29#include <vppinfra/types.h>
30
31/* Basic definitions: coordinates and points. */
32typedef double xy_float_t;
33typedef __complex__ double xy_t;
34typedef __complex__ int ixy_t;
35
36typedef __complex__ char i8xy_t;
37typedef __complex__ short i16xy_t;
38typedef __complex__ int i32xy_t;
39
40/* X/Y components of a point: can be used as either rvalue/lvalue. */
41#define xy_x(x) __real__ (x)
42#define xy_y(x) __imag__ (x)
43
44/* Unit vectors in x/y directions. */
45#define xy_x_unit_vector (1)
46#define xy_y_unit_vector (1I)
47
48#endif /* included_clib_xy_h */
Dave Barachc3799992016-08-15 11:12:27 -040049
50/*
51 * fd.io coding-style-patch-verification: ON
52 *
53 * Local Variables:
54 * eval: (c-set-style "gnu")
55 * End:
56 */