Posts

Showing posts from January, 2010

Sparkfun Freeday - A Bust

So many people on the net know about Sparkfun. It is a quirky website out of Boulder Colorado that sells electronic kits/gadgets/pcbs/components for building your own whatever. They concentrate on Ardunio type single board computers. Today was "Freeday" where they gave away $100 to the first 1ooo customers. But before today they made a big deal about how they tuned up their servers to handle the load. Maybe they were a bit optimistic but MANY people who tried to participate (including myself) spent 2 hours hitting "refresh" when all we had to do was click "confirm order." Now I (and many other people) have a huge level of frustration that because the site wouldn't let us through, we lost out. In other words the "free" offer was not played fairly because their servers slowed to a crawl. I would totally accept having the money go quickly (in something like 5 minutes) and I just missed out. But clicking refresh for 2 hours (literally

Rotation Around a Point

There are lots of code example that show rotation or a 2D point around the origin but what about around some arbitrary point? This is important if you are translating airfoils into G-Code... To do a rotation around a point without matrix math you translate the point to rotate around the origin (0,0,0), then rotate the point, and translate it back. So basically you subtract the location of the rotation point from the x coordinate, rotate the new point, and add the location of the rotation point back. Here it is in Python from math import * def rotate2d(degrees,point,origin): """ A rotation function that rotates a point around a point to rotate around the origin use [0,0] """ x = point[0] - origin[0] yorz = point[1] - origin[1] newx = (x*cos(radians(degrees))) - (yorz*sin(radians(degrees))) newyorz = (x*sin(radians(degrees))) (yorz*cos(radians(degrees))) newx = origin[0] newyorz = origin[1] return newx,newyorz