4 typedef struct _xy_pair Point;
5 typedef struct _xy_pair Vector;
10 typedef struct _Object Object;
11 typedef struct _Stick Stick;
12 typedef struct _String String;
13 typedef struct _Spring Spring;
14 typedef struct _OffsetSpring OffsetSpring;
15 typedef struct _Spacer Spacer;
16 typedef struct _Anchor Anchor;
17 typedef struct _Polygon Polygon;
18 typedef struct _Offset Offset;
19 typedef struct _Model Model;
25 Point previous_position;
53 struct _OffsetSpring {
86 int num_offset_springs;
87 OffsetSpring *offset_springs;
102 void object_init (Object *object, double x, double y, double mass);
103 void offset_spring_init (OffsetSpring *spring,
104 Object *a, Object *b, double dx, double dy);
105 void spring_init (Spring *spring, Object *a, Object *b, double length);
106 void stick_init (Stick *stick, Object *a, Object *b, double length);
107 void string_init (String *string, Object *a, Object *b, double length);
108 void spacer_init (Spacer *spacer, Object *a, Object *b, double length);
109 void anchor_init (Anchor *anchor, Object *object, double x, double y);
111 void polygon_init (Polygon *p, int enclosing, int num_points, ...);
112 void polygon_init_diamond (Polygon *polygon, double x, double y);
113 void polygon_init_rectangle (Polygon *polygon, double x0, double y0,
114 double x1, double y1);
115 void polygon_init_enclosing_rectangle (Polygon *polygon, double x0, double y0,
116 double x1, double y1);
118 void model_fini (Model *model);
120 void model_step (Model *model, double delta_t);
122 Object *model_find_nearest (Model *model, double x, double y);