Blender  V3.3
IK_Math.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #include <Eigen/Core>
11 #include <Eigen/Geometry>
12 
13 #include <cmath>
14 
15 using Eigen::Affine3d;
16 using Eigen::Matrix3d;
17 using Eigen::MatrixXd;
18 using Eigen::Vector3d;
19 using Eigen::VectorXd;
20 
21 static const double IK_EPSILON = 1e-20;
22 
23 static inline bool FuzzyZero(double x)
24 {
25  return fabs(x) < IK_EPSILON;
26 }
27 
28 static inline double Clamp(const double x, const double min, const double max)
29 {
30  return (x < min) ? min : (x > max) ? max : x;
31 }
32 
33 static inline Eigen::Matrix3d CreateMatrix(double xx,
34  double xy,
35  double xz,
36  double yx,
37  double yy,
38  double yz,
39  double zx,
40  double zy,
41  double zz)
42 {
43  Eigen::Matrix3d M;
44  M(0, 0) = xx;
45  M(0, 1) = xy;
46  M(0, 2) = xz;
47  M(1, 0) = yx;
48  M(1, 1) = yy;
49  M(1, 2) = yz;
50  M(2, 0) = zx;
51  M(2, 1) = zy;
52  M(2, 2) = zz;
53  return M;
54 }
55 
56 static inline Eigen::Matrix3d RotationMatrix(double sine, double cosine, int axis)
57 {
58  if (axis == 0)
59  return CreateMatrix(1.0, 0.0, 0.0, 0.0, cosine, -sine, 0.0, sine, cosine);
60  else if (axis == 1)
61  return CreateMatrix(cosine, 0.0, sine, 0.0, 1.0, 0.0, -sine, 0.0, cosine);
62  else
63  return CreateMatrix(cosine, -sine, 0.0, sine, cosine, 0.0, 0.0, 0.0, 1.0);
64 }
65 
66 static inline Eigen::Matrix3d RotationMatrix(double angle, int axis)
67 {
68  return RotationMatrix(sin(angle), cos(angle), axis);
69 }
70 
71 static inline double EulerAngleFromMatrix(const Eigen::Matrix3d &R, int axis)
72 {
73  double t = sqrt(R(0, 0) * R(0, 0) + R(0, 1) * R(0, 1));
74 
75  if (t > 16.0 * IK_EPSILON) {
76  if (axis == 0)
77  return -atan2(R(1, 2), R(2, 2));
78  else if (axis == 1)
79  return atan2(-R(0, 2), t);
80  else
81  return -atan2(R(0, 1), R(0, 0));
82  }
83  else {
84  if (axis == 0)
85  return -atan2(-R(2, 1), R(1, 1));
86  else if (axis == 1)
87  return atan2(-R(0, 2), t);
88  else
89  return 0.0f;
90  }
91 }
92 
93 static inline double safe_acos(double f)
94 {
95  // acos that does not return NaN with rounding errors
96  if (f <= -1.0)
97  return M_PI;
98  else if (f >= 1.0)
99  return 0.0;
100  else
101  return acos(f);
102 }
103 
104 static inline Eigen::Vector3d normalize(const Eigen::Vector3d &v)
105 {
106  // a sane normalize function that doesn't give (1, 0, 0) in case
107  // of a zero length vector
108  double len = v.norm();
109  return FuzzyZero(len) ? Eigen::Vector3d(0, 0, 0) : Eigen::Vector3d(v / len);
110 }
111 
112 static inline double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
113 {
114  return safe_acos(v1.dot(v2));
115 }
116 
117 static inline double ComputeTwist(const Eigen::Matrix3d &R)
118 {
119  // qy and qw are the y and w components of the quaternion from R
120  double qy = R(0, 2) - R(2, 0);
121  double qw = R(0, 0) + R(1, 1) + R(2, 2) + 1;
122 
123  double tau = 2.0 * atan2(qy, qw);
124 
125  return tau;
126 }
127 
128 static inline Eigen::Matrix3d ComputeTwistMatrix(double tau)
129 {
130  return RotationMatrix(tau, 1);
131 }
132 
133 static inline void RemoveTwist(Eigen::Matrix3d &R)
134 {
135  // compute twist parameter
136  double tau = ComputeTwist(R);
137 
138  // compute twist matrix
139  Eigen::Matrix3d T = ComputeTwistMatrix(tau);
140 
141  // remove twist
142  R = R * T.transpose();
143 }
144 
145 static inline Eigen::Vector3d SphericalRangeParameters(const Eigen::Matrix3d &R)
146 {
147  // compute twist parameter
148  double tau = ComputeTwist(R);
149 
150  // compute swing parameters
151  double num = 2.0 * (1.0 + R(1, 1));
152 
153  // singularity at pi
154  if (fabs(num) < IK_EPSILON)
155  // TODO: this does now rotation of size pi over z axis, but could
156  // be any axis, how to deal with this I'm not sure, maybe don't
157  // enforce limits at all then.
158  return Eigen::Vector3d(0.0, tau, 1.0);
159 
160  num = 1.0 / sqrt(num);
161  double ax = -R(2, 1) * num;
162  double az = R(0, 1) * num;
163 
164  return Eigen::Vector3d(ax, tau, az);
165 }
166 
167 static inline Eigen::Matrix3d ComputeSwingMatrix(double ax, double az)
168 {
169  // length of (ax, 0, az) = sin(theta/2)
170  double sine2 = ax * ax + az * az;
171  double cosine2 = sqrt((sine2 >= 1.0) ? 0.0 : 1.0 - sine2);
172 
173  // compute swing matrix
174  Eigen::Matrix3d S(Eigen::Quaterniond(-cosine2, ax, 0.0, az));
175 
176  return S;
177 }
178 
179 static inline Eigen::Vector3d MatrixToAxisAngle(const Eigen::Matrix3d &R)
180 {
181  Eigen::Vector3d delta = Eigen::Vector3d(R(2, 1) - R(1, 2), R(0, 2) - R(2, 0), R(1, 0) - R(0, 1));
182 
183  double c = safe_acos((R(0, 0) + R(1, 1) + R(2, 2) - 1) / 2);
184  double l = delta.norm();
185 
186  if (!FuzzyZero(l))
187  delta *= c / l;
188 
189  return delta;
190 }
191 
192 static inline bool EllipseClamp(double &ax, double &az, double *amin, double *amax)
193 {
194  double xlim, zlim, x, z;
195 
196  if (ax < 0.0) {
197  x = -ax;
198  xlim = -amin[0];
199  }
200  else {
201  x = ax;
202  xlim = amax[0];
203  }
204 
205  if (az < 0.0) {
206  z = -az;
207  zlim = -amin[1];
208  }
209  else {
210  z = az;
211  zlim = amax[1];
212  }
213 
214  if (FuzzyZero(xlim) || FuzzyZero(zlim)) {
215  if (x <= xlim && z <= zlim)
216  return false;
217 
218  if (x > xlim)
219  x = xlim;
220  if (z > zlim)
221  z = zlim;
222  }
223  else {
224  double invx = 1.0 / (xlim * xlim);
225  double invz = 1.0 / (zlim * zlim);
226 
227  if ((x * x * invx + z * z * invz) <= 1.0)
228  return false;
229 
230  if (FuzzyZero(x)) {
231  x = 0.0;
232  z = zlim;
233  }
234  else {
235  double rico = z / x;
236  double old_x = x;
237  x = sqrt(1.0 / (invx + invz * rico * rico));
238  if (old_x < 0.0)
239  x = -x;
240  z = rico * x;
241  }
242  }
243 
244  ax = (ax < 0.0) ? -x : x;
245  az = (az < 0.0) ? -z : z;
246 
247  return true;
248 }
sqrt(x)+1/max(0
#define M_PI
Definition: BLI_math_base.h:20
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
static double EulerAngleFromMatrix(const Eigen::Matrix3d &R, int axis)
Definition: IK_Math.h:71
static void RemoveTwist(Eigen::Matrix3d &R)
Definition: IK_Math.h:133
static bool EllipseClamp(double &ax, double &az, double *amin, double *amax)
Definition: IK_Math.h:192
static Eigen::Vector3d normalize(const Eigen::Vector3d &v)
Definition: IK_Math.h:104
static Eigen::Matrix3d CreateMatrix(double xx, double xy, double xz, double yx, double yy, double yz, double zx, double zy, double zz)
Definition: IK_Math.h:33
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Definition: IK_Math.h:112
static Eigen::Vector3d MatrixToAxisAngle(const Eigen::Matrix3d &R)
Definition: IK_Math.h:179
static const double IK_EPSILON
Definition: IK_Math.h:21
static double ComputeTwist(const Eigen::Matrix3d &R)
Definition: IK_Math.h:117
static double safe_acos(double f)
Definition: IK_Math.h:93
static double Clamp(const double x, const double min, const double max)
Definition: IK_Math.h:28
static Eigen::Matrix3d RotationMatrix(double sine, double cosine, int axis)
Definition: IK_Math.h:56
static Eigen::Matrix3d ComputeTwistMatrix(double tau)
Definition: IK_Math.h:128
static Eigen::Vector3d SphericalRangeParameters(const Eigen::Matrix3d &R)
Definition: IK_Math.h:145
static Eigen::Matrix3d ComputeSwingMatrix(double ax, double az)
Definition: IK_Math.h:167
static bool FuzzyZero(double x)
Definition: IK_Math.h:23
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
int len
Definition: draw_manager.c:108
ccl_device_inline float2 fabs(const float2 &a)
Definition: math_float2.h:222
#define M
#define T
#define R
static unsigned c
Definition: RandGen.cpp:83
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:319
INLINE Rall1d< T, V, S > acos(const Rall1d< T, V, S > &x)
Definition: rall1d.h:399
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:311
INLINE Rall1d< T, V, S > atan2(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
Definition: rall1d.h:429
#define min(a, b)
Definition: sort.c:35
float max
int xy[2]
Definition: wm_draw.c:135