Which method of drawing a line is faster?

So I generally know there are two ways to render a line one with bresehnams line algorithm and one with trigonometry.

double grad = Math.atan2((lineendx - linestartx),(lineendy - linestarty));
double xincrement = Math.sin(grad);
double yincrement = Math.cos(grad);

Trig is slow.

Well ive been about to do over 100,000 trig operations with no defect to performance.

Trig is slower.

Whenever you see atan2 + cos&sin, the obvious choice is to normalize the vector instead.


double angle = Math.atan2(dy, dx);
double x= Math.sin(angle);
double y= Math.cos(angle);

==


double invLen = 1.0 / Math.sqrt(dx*dx + dy*dy);
double x = dx * invLen;
double y = dy * invLen;

However… pick Bresenham.

f**k Y i finaly find out this XD
offtop sorry


		double rad = Math.toRadians(33);
		double Cos = Math.cos(rad);
		double Sin = Math.sin(rad);
		double len = 4;
		double x = len * Sin;
		double y = len * Cos;
		//////////////////////////////////////////
		//Direction normalize
		double len_Sq = Math.sqrt(x * x + y * y);
		double invlen = 1d / len_Sq;
		double Cos2 = y * invlen;
		double Sin2 = x * invlen;
		////////////////////////
		double x2 = len * Sin2;
		double y2 = len * Cos2;
		double len2 = (x2 / Sin2 + y2 / Cos2) / 2;
		//	x == x2, Sin == Sin2
		//	y == y2, Cos == Cos2
		//	len2 == 4