How big should you make a ring-shaped orbital to get a 24-hour day?
Centrifugal acceleration a = v^2 / r
9.8 m / s^2 = v^2 / r
v = 1 rev / day = 2 * pi * r / 86400 s
9.8 m / s^2 = (2 * pi * r / 86400 s) ^ 2 / r
= 5.289 * 10 ^ -9 * r
r = 1,853,078,528.45 m =~1.85 million km.
Yep, Banks got it about right.
Monday, April 15, 2013
Friday, December 14, 2012
This is the first time I've seen anyone make this connection in a scientific fashion. Check the research is solid before repeating it.
http://www.newscientist.com/article/dn17922-carrying-a-gun-increases-risk-of-getting-shot-and-killed.html
Sunday, October 28, 2012
Cones
Geekin out the maths, and might actually have a use for this again someday. How to custom-design a piece of a cone, to step a cylinder of one size down to another.
I want to step a cylinder of radius r1 down to a new radius r2 over a distance of d. This is a section "trimmed" off the top edge of a cone, so the trick is to first describe the cone. The height of the full cone (h1), the length of its side (s1), and the radius of the larger disk (r1) form a right triangle. Next describe the smaller cone we're cutting off the tip of the larger. The height of the offcut (h2), the length of its side, and the radius of the smaller disk (r2) also form a right triangle. The angle between the height and the side in each of these triangles must be identical. The tangent of that angle is the ratio of the radius over the height, and it also must be identical between the two triangles, so r1/h1 = r2/h2. r1 and r2 were given, and h1 = h2 + d, so we solve for h2:
r1*h2 = r2*h1
h2 = r2/r1*(h2+d)
h2*(1-r2/r1) = r2/r1*d
h2 = r2/r1*d/(1-r2/r1)
h2 = d*r2/(r1-r2)
To draw a template for this cone on flat paper we need a circular sector. The radius of this sector is the length of the side of the cone, which is just the hypoteneuse of the first triangle we described above: s1 = (r1^2 + h1^2)^(1/2). The angle of the sector - effectively, the proportion of a whole disk we use - we can find from the fact that the outer circumference of the sector (not including the "pie cuts") must be equal to the circumference of the base of the cone, which is the disk with r1 from way back in the problem definition. So portion of the disk to use is the ratio of (2*pi*r1)/(2*pi*s1), or simply r1/s1.
So in my case I want to go from a diameter of 5/8" to 3/8" in the course of 3/8". To make life easier, I'll do everything in 16ths.
r1 = 5
r2 = 3
d = 6
h2 = 6*3/(5-3) = 9
h1 = 15
s1 = (5^2 + 15^2)^(1/2) = 15.81
s2 = (3^2 + 9^2)^(1/2) = 9.49
And I want 5/15.81 = 31.62% or 113.84 degrees.
But OpenOffice Draw is not a CAD program, and it won't let me specify the number of degrees in a sector. *grumble*. So subtracting 90 for the orientation, I get sin(23.84) = 0.40, and draw the sector out til its 1.40 inches long with a radius of 1.
(And confirmed by the "print-it-out-and-build-it method...)
I want to step a cylinder of radius r1 down to a new radius r2 over a distance of d. This is a section "trimmed" off the top edge of a cone, so the trick is to first describe the cone. The height of the full cone (h1), the length of its side (s1), and the radius of the larger disk (r1) form a right triangle. Next describe the smaller cone we're cutting off the tip of the larger. The height of the offcut (h2), the length of its side, and the radius of the smaller disk (r2) also form a right triangle. The angle between the height and the side in each of these triangles must be identical. The tangent of that angle is the ratio of the radius over the height, and it also must be identical between the two triangles, so r1/h1 = r2/h2. r1 and r2 were given, and h1 = h2 + d, so we solve for h2:
r1*h2 = r2*h1
h2 = r2/r1*(h2+d)
h2*(1-r2/r1) = r2/r1*d
h2 = r2/r1*d/(1-r2/r1)
h2 = d*r2/(r1-r2)
To draw a template for this cone on flat paper we need a circular sector. The radius of this sector is the length of the side of the cone, which is just the hypoteneuse of the first triangle we described above: s1 = (r1^2 + h1^2)^(1/2). The angle of the sector - effectively, the proportion of a whole disk we use - we can find from the fact that the outer circumference of the sector (not including the "pie cuts") must be equal to the circumference of the base of the cone, which is the disk with r1 from way back in the problem definition. So portion of the disk to use is the ratio of (2*pi*r1)/(2*pi*s1), or simply r1/s1.
So in my case I want to go from a diameter of 5/8" to 3/8" in the course of 3/8". To make life easier, I'll do everything in 16ths.
r1 = 5
r2 = 3
d = 6
h2 = 6*3/(5-3) = 9
h1 = 15
s1 = (5^2 + 15^2)^(1/2) = 15.81
s2 = (3^2 + 9^2)^(1/2) = 9.49
And I want 5/15.81 = 31.62% or 113.84 degrees.
But OpenOffice Draw is not a CAD program, and it won't let me specify the number of degrees in a sector. *grumble*. So subtracting 90 for the orientation, I get sin(23.84) = 0.40, and draw the sector out til its 1.40 inches long with a radius of 1.
(And confirmed by the "print-it-out-and-build-it method...)
Sunday, April 8, 2012
multi-dimensional hash slices in Perl
I've tripped over this enough times that you'd think I'd remember it by now, but I never do. And looking up the answer on google always seems to take me an age. So, in keeping with the title of this blog, I shall squirrel it away here in hopes that I'll remember to look here first next time...
I love slices in perl. They're brilliant. But they really don't quite do what you wish they'd do if you're trying to take a slice in the first dimension of a multi-dimensional hash. So if I've got:
%thing = ( "A" => [ "A0","A1","A2","A3" ],
"B" => ["B0","B1","B2","B3"],
"C" => ["C0","C1","C2","C3"]
);
I can happily slice up the last dimension on a constant "column" of the first:
print join ", ", @{$thing{B}}[1..2], "\n";
I can't do the reverse:
# doesn't work
#print join ", ", @thing{B..C}[1], "\n";
There are a couple of ways around this, some of which only work in certain circumstances:
print join ", ", ( map {$_->[1]} @thing{B..C} ), "\n";
works for output, but you don't have a ref to the original object anymore, so you can't change it. So while:
foreach ( @{$thing{B}}[1..2] ) {
s/B/E/;
}
Does what you'd expect - changes the values in B1 and B2:
foreach ( map {$_->[1]} @thing{B..C} ) {
s/1/4/;
}
...doesn't do the equivalent. Instead you need something like:
foreach ( B..C ) {
$thing{$_}[1] =~ s/1/4/;
}
(All of which seems pretty trivial from those examples, but when you try to do something complicated then being able to do all the referencing in the foreach parameter, and just work with $_ inside makes the code a LOT easier to read...)
I love slices in perl. They're brilliant. But they really don't quite do what you wish they'd do if you're trying to take a slice in the first dimension of a multi-dimensional hash. So if I've got:
%thing = ( "A" => [ "A0","A1","A2","A3" ],
"B" => ["B0","B1","B2","B3"],
"C" => ["C0","C1","C2","C3"]
);
I can happily slice up the last dimension on a constant "column" of the first:
print join ", ", @{$thing{B}}[1..2], "\n";
I can't do the reverse:
# doesn't work
#print join ", ", @thing{B..C}[1], "\n";
There are a couple of ways around this, some of which only work in certain circumstances:
print join ", ", ( map {$_->[1]} @thing{B..C} ), "\n";
works for output, but you don't have a ref to the original object anymore, so you can't change it. So while:
foreach ( @{$thing{B}}[1..2] ) {
s/B/E/;
}
Does what you'd expect - changes the values in B1 and B2:
foreach ( map {$_->[1]} @thing{B..C} ) {
s/1/4/;
}
...doesn't do the equivalent. Instead you need something like:
foreach ( B..C ) {
$thing{$_}[1] =~ s/1/4/;
}
(All of which seems pretty trivial from those examples, but when you try to do something complicated then being able to do all the referencing in the foreach parameter, and just work with $_ inside makes the code a LOT easier to read...)
Tuesday, January 31, 2012
Weej
They say only the good die young. Well that's shit, but I wish it were true.
Weej was brilliant, and wicked, and magnificent, and big-hearted, and conniving, and mischievous, and brilliant. And never in his life was he anything as bland and pedestrian as merely "good". Oatmeal is "good". Weej was chipotle-marinated spare ribs with garlic-truffle-oil potato mash, a glass of Shiraz, and a double espresso to follow. And probably one of those horrible smoke-sticks of his too. Weej could fill an empty room with a grin.
I read about other people dealing with death, and many say they find comfort in the idea of a god. I'd never dream of taking away anyone's solace at a time like this even if I could - so I'll hide this self-absorbed rant away on this backwater blog where it won't bother anyone. But I've got to get it out. I want to scream it from a rooftop. How could this make you want to worship a god? I want to _invent_ one, just so I can hunt the fucker down and kick his lily-white arse! If I actually believed one was real I'm not sure I could stop myself from writing "Yeah? Well Fuck You Too!" on the side of a mountain in 40-foot letters made of burning bibles. Keep your fucker of a god; I want my friend back.
Weej was brilliant, and wicked, and magnificent, and big-hearted, and conniving, and mischievous, and brilliant. And never in his life was he anything as bland and pedestrian as merely "good". Oatmeal is "good". Weej was chipotle-marinated spare ribs with garlic-truffle-oil potato mash, a glass of Shiraz, and a double espresso to follow. And probably one of those horrible smoke-sticks of his too. Weej could fill an empty room with a grin.
I read about other people dealing with death, and many say they find comfort in the idea of a god. I'd never dream of taking away anyone's solace at a time like this even if I could - so I'll hide this self-absorbed rant away on this backwater blog where it won't bother anyone. But I've got to get it out. I want to scream it from a rooftop. How could this make you want to worship a god? I want to _invent_ one, just so I can hunt the fucker down and kick his lily-white arse! If I actually believed one was real I'm not sure I could stop myself from writing "Yeah? Well Fuck You Too!" on the side of a mountain in 40-foot letters made of burning bibles. Keep your fucker of a god; I want my friend back.
Friday, August 5, 2011
Bike gear ratios
I'd been idly wondering for awhile now about two things:
1) How far my bike commute to and from work really is.
2) How the different gear combinations on my bike compare to each other.
So a week or so ago I worked it out:
Number of teeth on each of my front three gears: 22, 32, 42
Number of teeth on my back 8 gears: 11, 13, 15, 18, 21, 24, 28, 32
Gear ratios, in descending order:
3/8 3.8181818182
3/7 3.2307692308
2/8 2.9090909091
3/6 2.8
2/7 2.4615384615
3/5 2.3333333333
2/6 2.1333333333
3/4 2
1/8 2
2/5 1.7777777778
3/3 1.75
1/7 1.6923076923
2/4 1.5238095238
3/2 1.5
1/6 1.4666666667
2/3 1.3333333333
3/1 1.3125
1/5 1.2222222222
2/2 1.1428571429
1/4 1.0476190476
2/1 1
1/3 0.9166666667
1/2 0.7857142857
1/1 0.6875
So for all intents and purposes, shifting the front gear changes the effective ratio by about 2 "notches": 1 and 8 is about the same as 2 and 6 is about the same as 3 and 4.
Having worked that out, I measured the outer diameter of my bike tire - 82.5 inches - and worked out that if I leave it in 3/6 (which is around where I generally ride) and never backpedal, it takes about 69 turns of the crank to go a quarter mile:
5280 ft/mile * 12 in/ft / 82.5 inches/wheel = 768.0 wheels/mile
768.0 wheels/mile / 2.8 wheels/pedal = 274.3 pedals/mile
274.3 / 4 = 68.6 pedals in a quarter mile.
Then I rode home by my usual route, without changing gears and without backpedalling (which is surprisingly hard) and it comes out very close to three and a quarter miles. Which is pretty darn close to what Google Maps comes up with, even though it doesn't let me trace my actual route, which winds in and out of some back alleys and such.
I can't really imagine why I'd want to know this again later, but I haven't really got anywhere else to put it at the moment...
1) How far my bike commute to and from work really is.
2) How the different gear combinations on my bike compare to each other.
So a week or so ago I worked it out:
Number of teeth on each of my front three gears: 22, 32, 42
Number of teeth on my back 8 gears: 11, 13, 15, 18, 21, 24, 28, 32
Gear ratios, in descending order:
3/8 3.8181818182
3/7 3.2307692308
2/8 2.9090909091
3/6 2.8
2/7 2.4615384615
3/5 2.3333333333
2/6 2.1333333333
3/4 2
1/8 2
2/5 1.7777777778
3/3 1.75
1/7 1.6923076923
2/4 1.5238095238
3/2 1.5
1/6 1.4666666667
2/3 1.3333333333
3/1 1.3125
1/5 1.2222222222
2/2 1.1428571429
1/4 1.0476190476
2/1 1
1/3 0.9166666667
1/2 0.7857142857
1/1 0.6875
So for all intents and purposes, shifting the front gear changes the effective ratio by about 2 "notches": 1 and 8 is about the same as 2 and 6 is about the same as 3 and 4.
Having worked that out, I measured the outer diameter of my bike tire - 82.5 inches - and worked out that if I leave it in 3/6 (which is around where I generally ride) and never backpedal, it takes about 69 turns of the crank to go a quarter mile:
5280 ft/mile * 12 in/ft / 82.5 inches/wheel = 768.0 wheels/mile
768.0 wheels/mile / 2.8 wheels/pedal = 274.3 pedals/mile
274.3 / 4 = 68.6 pedals in a quarter mile.
Then I rode home by my usual route, without changing gears and without backpedalling (which is surprisingly hard) and it comes out very close to three and a quarter miles. Which is pretty darn close to what Google Maps comes up with, even though it doesn't let me trace my actual route, which winds in and out of some back alleys and such.
I can't really imagine why I'd want to know this again later, but I haven't really got anywhere else to put it at the moment...
Friday, January 7, 2011
Of Balloons and Bridges
The religious zealot who denies science - and yes, I'm looking at you, Creationists - sees science as just another belief system. Since their religion is based on belief, not fact, questioning any part of it is to question the whole. To disprove any part of it would be to bring the entire edifice of faith tumbling down. Its not supported from the outside, like a bridge; it supports itself, like a balloon. Even a small hole is bad for a balloon.
These people expect science to behave the same way. So when they find a gap which the current scientific theory fails to explain, or prove one of its predictions wrong, or read about some scientist caught fudging their data, they clap their hands and say "Ha! Told you so!" as if the entire discussion were now over, and they'd been proven right. Scientists and skeptics then go into conniptions about the religious folk being disingenuous because proving one thing wrong doesn't necessarily prove anything else in particular to be right, but I think many of the zealots are genuinely confused by such arguments. Obviously, they've already proved your belief system to be false; why is the discussion still going on? They've poked a hole in your balloon - have the decency to fall. Meanwhile the true scientist looks at the gap, or the error, or the fraud, and simply nods and says "Yep; thats how science works." And then gets to work making the next revision better.
Noone really seriously bothers to expose gaps, or contradictions, or frauds in religion, except possibly as a form of entertainment. There wouldn't be anything left.
These people expect science to behave the same way. So when they find a gap which the current scientific theory fails to explain, or prove one of its predictions wrong, or read about some scientist caught fudging their data, they clap their hands and say "Ha! Told you so!" as if the entire discussion were now over, and they'd been proven right. Scientists and skeptics then go into conniptions about the religious folk being disingenuous because proving one thing wrong doesn't necessarily prove anything else in particular to be right, but I think many of the zealots are genuinely confused by such arguments. Obviously, they've already proved your belief system to be false; why is the discussion still going on? They've poked a hole in your balloon - have the decency to fall. Meanwhile the true scientist looks at the gap, or the error, or the fraud, and simply nods and says "Yep; thats how science works." And then gets to work making the next revision better.
Noone really seriously bothers to expose gaps, or contradictions, or frauds in religion, except possibly as a form of entertainment. There wouldn't be anything left.
Subscribe to:
Posts (Atom)

