re finding equally spaced points on a sphere in article trd rpi edu deweeset ptolemy rdrc rpi edu thomas e deweese writes hello i know that this has been discussed before but at the time i didn t need to teselate a sphere so if any kind soul has the code or the alg that was finally decided upon as the best as i recall it was a nice iterative subdivision meathod i would be very appreciative here is one by andrew graphics gems glassner that i got from a collegue of mine i think i fiddled with it a little bit to make it deal with whatever bizarre problem i was working on at the time but it is known to work spl spheres asg feb spl thu mar est include stdio h include math h define pi struct point struct double x y z static double radius static double xorg static double yorg static double zorg do sphere r freq x y z double r int freq double x double y double z int pole double northy southy poley double rtheta rtheta ntheta ntheta magicangle double theta thetastart thisy den t struct point node pnp struct point struct p p p p n n n n pt radius r xorg x yorg y zorg z north pole magicangle pi northy radius sin magicangle southy radius sin magicangle for pole pole pole if pole poley radius thisy northy thetastart else poley radius thisy southy thetastart for theta thetastart theta theta rtheta theta pi rtheta theta pi p x p y poley p z p x radius cos rtheta p y thisy p z radius sin rtheta p x radius cos rtheta p y thisy p z radius sin rtheta if pole make ring go the other way so normals are right pt x p x pt y p y pt z p z p x p x p y p y p z p z p x pt x p y pt y p z pt z den p x p x p y p y p z p z den sqrt den if den t radius den p x t p y t p z t den p x p x p y p y p z p z den sqrt den if den t radius den p x t p y t p z t den p x p x p y p y p z p z den sqrt den if den t radius den p x t p y t p z t subdivide tri p p p freq now the body for theta theta theta rtheta theta pi rtheta theta pi ntheta theta pi ntheta theta pi p x radius cos rtheta p y northy p z radius sin rtheta p x radius cos rtheta p y northy p z radius sin rtheta p x radius cos ntheta p y southy p z radius sin ntheta p x radius cos ntheta p y southy p z radius sin ntheta den p x p x p y p y p z p z den sqrt den if den t radius den p x t p y t p z t den p x p x p y p y p z p z den sqrt den if den t radius den p x t p y t p z t den p x p x p y p y p z p z den sqrt den if den t radius den p x t p y t p z t den p x p x p y p y p z p z den sqrt den if den t radius den p x t p y t p z t subdivide tri p p p freq subdivide tri p p p freq return define norm pt v register double r sqrt v x v x v y v y v z v z v x r v y r v z r subdivide tri p p p a struct point struct p p p int a struct point struct n n n struct point struct p p p double den t if a p x p x p x p y p y p y p z p z p z den p x p x p y p y p z p z den sqrt den if den t radius den p x t p y t p z t p x p x p x p y p y p y p z p z p z den p x p x p y p y p z p z den sqrt den if den t radius den p x t p y t p z t p x p x p x p y p y p y p z p z p z den p x p x p y p y p z p z den sqrt den if den t radius den p x t p y t p z t subdivide tri p p p a subdivide tri p p p a subdivide tri p p p a subdivide tri p p p a else n x p x n y p y n z p z norm pt n n x p x n y p y n z p z norm pt n n x p x n y p y n z p z norm pt n nothing special about this poly printf f f f f f f n p x xorg p y yorg p z zorg n x n y n z printf f f f f f f n p x xorg p y yorg p z zorg n x n y n z printf f f f f f f n p x xorg p y yorg p z zorg n x n y n z return steve lamont sciviguy spl szechuan ucsd edu san diego microscopy and imaging resource uc san diego la jolla ca my other car is a car too bumper strip seen on i
