Skip to content

Instantly share code, notes, and snippets.

View cjameshuff's full-sized avatar

Christopher James Huff cjameshuff

View GitHub Profile
v = sqrt(G*m*(2/r - 2/(r1 + r2)))
v1 = sqrt(G*m*(2/r1 - 2/(r1 + r2)))
v2 = sqrt(G*m*(2/r2 - 2/(r1 + r2)))
v1^2/G = m*(2/r1 - 2/(r1 + r2))
v1^2/G/(2/r1 - 2/(r1 + r2)) = m
130141 m 2129.0 m/s
0 km, Vcirc = 2425.56 m/s, Vesc = 3430.27 m/s
50 km, Vcirc = 2330.41 m/s, Vesc = 3295.69 m/s
100 km, Vcirc = 2245.64 m/s, Vesc = 3175.81 m/s
150 km, Vcirc = 2169.49 m/s, Vesc = 3068.12 m/s
200 km, Vcirc = 2100.60 m/s, Vesc = 2970.70 m/s
250 km, Vcirc = 2037.88 m/s, Vesc = 2882.00 m/s
300 km, Vcirc = 1980.46 m/s, Vesc = 2800.80 m/s
350 km, Vcirc = 1927.64 m/s, Vesc = 2726.10 m/s
400 km, Vcirc = 1878.83 m/s, Vesc = 2657.07 m/s
450 km, Vcirc = 1833.55 m/s, Vesc = 2593.04 m/s
0 km, Vcirc = 2425.56 m/s, Tcirc = 25.90 min, Vesc = 3430.27 m/s
5 km, Vcirc = 2415.52 m/s, Tcirc = 26.23 min, Vesc = 3416.06 m/s
10 km, Vcirc = 2405.60 m/s, Tcirc = 26.55 min, Vesc = 3402.03 m/s
15 km, Vcirc = 2395.80 m/s, Tcirc = 26.88 min, Vesc = 3388.18 m/s
20 km, Vcirc = 2386.12 m/s, Tcirc = 27.21 min, Vesc = 3374.49 m/s
25 km, Vcirc = 2376.56 m/s, Tcirc = 27.54 min, Vesc = 3360.96 m/s
30 km, Vcirc = 2367.11 m/s, Tcirc = 27.87 min, Vesc = 3347.60 m/s
35 km, Vcirc = 2357.77 m/s, Tcirc = 28.20 min, Vesc = 3334.39 m/s
40 km, Vcirc = 2348.54 m/s, Tcirc = 28.54 min, Vesc = 3321.34 m/s
45 km, Vcirc = 2339.42 m/s, Tcirc = 28.87 min, Vesc = 3308.44 m/s
def obj_yrotate(srcobjfile, dstobjfile, amt)
sinang = Math.sin(amt*Math::PI/180.0)
cosang = Math.cos(amt*Math::PI/180.0)
fin = File.open(srcobjfile, 'r')
fout = File.open(dstobjfile, 'w')
fin.each_line {|line|
if(line.start_with?('v '))
v = line.split(' ')[1, 3].map{|x| x.to_f}
#!/usr/bin/env ruby
require 'pp'
require 'pathname'
require 'fileutils'
def obj_yrotate(srcobjfile, dstobjfile, amt)
sinang = Math.sin(amt*Math::PI/180.0)
cosang = Math.cos(amt*Math::PI/180.0)
def lpcrc(fw)
# fix CRC (thanks to Roel Verdult for the lpcrc utility this is based on)
blocks = fw.unpack('V7') # read 7 little endian 32-bit integers
crc = (~(blocks.inject(0) {|crc, block| (crc + block) & 0xFFFFFFFF}) + 1) & 0xFFFFFFFF
fw[7*4, 4] = [crc].pack('V')
fw
end
{bLength: (uint8_t)18,
bDescriptorType: (uint8_t)1,
bcdUSB: (uint16_t)512,
bDeviceClass: (uint8_t)255,
bDeviceSubClass: (uint8_t)254,
bDeviceProtocol: (uint8_t)0,
bMaxPacketSize0: (uint8_t)64,
idVendor: (uint16_t)8137,
idProduct: (uint16_t)3,
bcdDevice: (uint16_t)256,
class Pry
retrieve_line = self.instance_method(:retrieve_line)
define_method(:retrieve_line) do |eval_string, target|
puts "*"
retrieve_line.bind(self).call(eval_string, target)
end
end
t = Thread.new {10.times {|x| puts x; sleep 1}}
while buf = Readline.readline
p buf
if(buf == 'q')
break
end
end
require 'inline'
class BetterReadline
inline :C do |builder|
builder.include '<ruby.h>'
builder.include '<readline/readline.h>'
src = <<END
VALUE readline_intern(void * data) {
char ** rstr = (char **)data;
*rstr = readline(NULL);
return Qnil;