This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
parts: { | |
test_shape: { | |
shape: union | |
children: [ | |
{shape: sphere, center: [0, 0, 5], radius: 4.5} | |
{shape: sphere, center: [-2, 0,-1], radius: 2.1} | |
{shape: sphere, center: [2, 0,-1], radius: 2.1} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qeg.GenerateFromFaces(faces.size(), vertices.size(), | |
[this](ind_t faceIdx, ind_t & a, ind_t & b, ind_t & c){ | |
auto & face = faces[faceIdx]; | |
a = face.vertices[0]; | |
b = face.vertices[1]; | |
c = face.vertices[2]; | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef TEST_DEFS_H | |
#define TEST_DEFS_H | |
#include "flexproto.h" | |
using namespace flexproto; | |
struct Point { | |
int32_t x; | |
int32_t y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def to_bin(bits) bits.to_s(2).rjust(64, '0') end | |
x = 0xFFFFFFFFFFFFFFFF | |
puts to_bin(x) | |
x = ((x & 0x00000000001FFC00) << 20) | (x & 0x00000000000003FF) | |
puts to_bin(x) | |
x = ((x & 0x000001F8000003E0) << 10) | (x & 0x00000007C000001F) | |
puts to_bin(x) | |
x = ((x & 0x00070006000C0018) << 6) | (x & 0x0000E001C0038007) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer