Every Pythagorean triple is some multiple of a permutation of (p^2 + q^2, p^2 - q^2, 2*p*q) for integer p,q . The number of such triples with hypoteneuse at most Z equals (roughly) the number of lattice points within a circle of radius sqrt(Z) , hence is linear in Z . WFL On 8/14/13, Henry Baker <hbaker1@pipeline.com> wrote:
I did some simple calculations just to get a handle on the size of integers involved.
Suppose we want to plot 100,000 points equally spaced around a circle of radius R on a square pixel grid.
Suppose we want the 'second' point R*(cos(2pi/N)+i*sin(2pi/N) to be exactly 1 pixel different in its X-coordinate from the 'first' point R*(cos(0)+i*sin(0)).
Then R*(cos(0)-cos(2pi/N))=1. Now if we Taylor cos(x)~1-x^2/2, then we can solve for R in terms of N:
2*R = D = (N/pi)^2
R = 506,605,918, i.e., the grid must be 2^30 pixels wide & 2^30 pixels high.
It is also interesting to see how far above the 'first' pixel the 'second' pixel lies:
Tayloring sin(x) ~ x,
R*sin(2pi/N) ~ R*(2pi/N) = N/pi. For N=100000, R*sin(2pi/N) ~ 31,831.
So, exp(i2pi/100000) ~ 506,605,917 + 31,831*i = (R-1) + 31,831*i = Z
Computing the convex hull of a regular n-gon of 100,000 points requires 30-bit integers just to accurately represent the points; note that these coordinate values are approx. twice the number of bits required to represent N itself.
But this number Z that we just found isn't even Pythagorean.
We can get a Pythagorean number for double the angle (i.e., 4pi/N) by squaring Z and dividing by its norm:
Z2 = Z^2/(Z*Z') (Z' is conjugate of Z)
Unfortunately, this denominator 128,324,778,076,311,725 requires 57 bits to represent; i.e., approx. double the number of bits of Z's denominator.
So, attempting to utilize Pythagorean numbers for representing uniformly spaced points around the circle seems to _double_ the number of bits involved.
Doubling the size of the numbers seems a bit extreme; are Pythagorean triples really that rare?
I hope that I'm wrong about this.
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun