#ifndef INCLUDE_ONCE_VECTOR_FIELD_BEADS_2D
#define INCLUDE_ONCE_VECTOR_FIELD_BEADS_2D

#include <cmath>
#include <algorithm>

typedef std::pair<double, double> Vec2d;

class beads2d
{
public:
	// Samples the vector field of the Beads problem
	Vec2d sample(double x, double y, double t)
	{
		return Vec2d(
			-2 * y + (2 * std::sin(t)) / 3,
			+2 * x - (2 * std::cos(t)) / 3);
	}

	// Samples the x-partial of the vector field of the Beads problem
	Vec2d sample_dx(double x, double y, double t)
	{
		return Vec2d(
			0,
			2);
	}

	// Samples the y-partial of the vector field of the Beads problem
	Vec2d sample_dy(double x, double y, double t)
	{
		return Vec2d(
			-2,
			0);
	}

	// Samples the t-partial of the vector field of the Beads problem
	Vec2d sample_dt(double x, double y, double t)
	{
		return Vec2d(
			(2 * std::cos(t)) / 3,
			(2 * std::sin(t)) / 3);
	}
};

#endif