#include <v_lib.h>

void
dxfLine4f(vhandle_t out,vec_t x1,vec_t y1,vec_t x2,vec_t y2)
{
	vec3_t p1, p2;
	vec3Set(p1,x1,y1,0);
	vec3Set(p2,x2,y2,0);
	dxfLine(out,p1,p2);
}

vec_t	get_x(vec_t t)
{
	return (vec_t)(2 * cos(t) + cos(7 * t));
}

vec_t	get_y(vec_t t)
{
	return (vec_t)(sin(t) + 2 * sin(5 * t));
}

int main()
{
	vec_t x1, y1, x2, y2, t, other_t, step = M_PI / 200;
	vhandle_t dxf = dxfOpenWrite("test.dxf");
	for(other_t = 15 * step, t = 0;t <= M_2PI;t += step, other_t += step)
	{
		x1 = get_x(t);
		y1 = get_y(t);
		x2 = get_x(other_t);
		y2 = get_y(other_t);
		dxfLine4f(dxf,x1,y1,x2,y2);
	}
	dxfClose(dxf);
	return 0;
}
