18 "description" :
"A floating-point 2-dimensional Cartesian spatial location.",
19 "keywords" : [
"coordinate" ],
42 VuoPoint2d point = {0,0};
44 json_type t = json_object_get_type(js);
45 if (t == json_type_string)
47 const char *s = json_object_get_string(js);
49 sscanf(s,
"%20g, %20g", &x, &y);
50 return (VuoPoint2d){x, y};
52 else if (t == json_type_array)
54 int len = json_object_array_length(js);
56 point.x = json_object_get_double(json_object_array_get_idx(js, 0));
58 point.y = json_object_get_double(json_object_array_get_idx(js, 1));
64 if (json_object_object_get_ex(js,
"x", &o))
66 else if (json_object_object_get_ex(js,
"X", &o))
69 if (json_object_object_get_ex(js,
"y", &o))
71 else if (json_object_object_get_ex(js,
"Y", &o))
86 json_object_object_add(js,
"x", xObject);
89 json_object_object_add(js,
"y", yObject);
108 return fabs(value1.x - value2.x) < 0.00001
109 && fabs(value1.y - value2.y) < 0.00001;