19 "description":
"A floating-point 4-dimensional Cartesian spatial location.",
20 "keywords": [
"coordinate" ],
46 VuoPoint4d point = {0,0,0,0};
48 json_type t = json_object_get_type(js);
49 if (t == json_type_string)
51 const char *s = json_object_get_string(js);
53 sscanf(s,
"%20g, %20g, %20g, %20g", &x, &y, &z, &w);
54 return (VuoPoint4d){x, y, z, w};
56 else if (t == json_type_array)
58 int len = json_object_array_length(js);
60 point.x = json_object_get_double(json_object_array_get_idx(js, 0));
62 point.y = json_object_get_double(json_object_array_get_idx(js, 1));
64 point.z = json_object_get_double(json_object_array_get_idx(js, 2));
66 point.w = json_object_get_double(json_object_array_get_idx(js, 3));
72 if (json_object_object_get_ex(js,
"x", &o))
74 else if (json_object_object_get_ex(js,
"X", &o))
77 if (json_object_object_get_ex(js,
"y", &o))
79 else if (json_object_object_get_ex(js,
"Y", &o))
82 if (json_object_object_get_ex(js,
"z", &o))
84 else if (json_object_object_get_ex(js,
"Z", &o))
87 if (json_object_object_get_ex(js,
"w", &o))
89 else if (json_object_object_get_ex(js,
"W", &o))
104 json_object_object_add(js,
"x", xObject);
107 json_object_object_add(js,
"y", yObject);
110 json_object_object_add(js,
"z", zObject);
113 json_object_object_add(js,
"w", wObject);
124 return VuoText_format(
"%g, %g, %g, %g", value.x, value.y, value.z, value.w);
149 min = max = points[0];
150 for (
unsigned long i = 1; i < count; ++i)
155 VuoPoint4d diff = max - min;
156 return diff.x <= tolerance.x
157 && diff.y <= tolerance.y
158 && diff.z <= tolerance.z
159 && diff.w <= tolerance.w;
183 return minimum.x <= value.x && value.x <= maximum.x
184 && minimum.y <= value.y && value.y <= maximum.y
185 && minimum.z <= value.z && value.z <= maximum.z
186 && minimum.w <= value.w && value.w <= maximum.w;
202 VuoPoint4d min = FLT_MAX;
203 for (
unsigned long i = 0; i < count; ++i)
207 *outputPosition = i + 1;
226 VuoPoint4d max = -FLT_MAX;
227 for (
unsigned long i = 0; i < count; ++i)
231 *outputPosition = i + 1;
250 VuoPoint4d divisor = count;
251 return sum / divisor;