This file contains hidden or 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
""" | |
Example recovering the C_x and C_y equations from OpenCV's rotation matrix | |
http://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html?highlight=getrotationmatrix2d#getrotationmatrix2d | |
""" | |
from sympy.solvers import solve | |
from sympy import Symbol, Eq, simplify | |
Alpha = Symbol('α') |
This file contains hidden or 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
CXX=g++ | |
CPPFLAGS= | |
CXXFLAGS=-O3 -Wall -Wextra -Werror -flto -std=c++14 -g -DNDEBUG | |
LDFLAGS=-flto -g | |
%.o: %.cpp | |
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< | |
SOURCES = \ | |
src/main.cpp \ |
This file contains hidden or 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
import numpy as np | |
R = np.array([[0, 1], | |
[1, 0]]) | |
p = np.array([3, 5]) | |
print(R @ p) | |
# > [5 3] |
This file contains hidden or 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
#pragma omp declare reduction( \ | |
+: \ | |
Matrix6d: \ | |
omp_out= omp_out + omp_in) \ | |
initializer(omp_priv=Matrix6d::Zero()) | |
#pragma omp declare reduction( \ | |
+: \ | |
Vector6d: \ | |
omp_out = omp_out + omp_in) \ | |
initializer(omp_priv=Vector6d::Zero()) |
This file contains hidden or 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
#include <cassert> | |
#include <iostream> | |
#include <map> | |
#include <unordered_map> | |
template <typename Map> | |
void | |
Remove(Map map) | |
{ |
This file contains hidden or 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
const VerticesData = [ | |
new Vertex(-12.9061002731, -0.974995017052, -1.30131995678), | |
new Vertex(-12.9061002731, -0.974995017052, 1.27499997616), | |
new Vertex(4.70302009583, -2.4135799408, -1.30131995678), | |
new Vertex(4.70302009583, -2.4135799408, 2.47499990463), | |
new Vertex(-14.3407001495, -2.97080993652, -1.30131995678), | |
new Vertex(-14.3407001495, -2.97080993652, 2.47499990463), | |
new Vertex(-13.8633003235, 7.62889003754, -1.30131995678), | |
new Vertex(-13.8633003235, 7.62889003754, 1.57500004768), | |
new Vertex(-7.00685977936, 13.7915000916, -1.30131995678), |
This file contains hidden or 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
#include <iostream> | |
template <typename Scalar> | |
void | |
print_bits(Scalar s) | |
{ | |
static_assert(sizeof(Scalar) == 4, "NO no no "); | |
uint32_t* k = (uint32_t*)&s; |
This file contains hidden or 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
#include <iostream> | |
#include <map> | |
#include <string> | |
using std::string; | |
namespace { | |
enum class SomeThing { | |
BLUE, |
This file contains hidden or 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 DOUGLASS_PEUKER_H_ | |
#define DOUGLASS_PEUKER_H_ | |
#include <stack> | |
#include <tuple> | |
#include <vector> | |
/// @{ | |
/// @tparam InputIterator Any STL style container |
This file contains hidden or 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
#include <cassert> | |
#include <functional> | |
#include <iostream> | |
#include <vector> | |
std::vector<int> V; | |
template <typename Container1, typename Container2> | |
std::ostream& | |
operator<<(std::ostream& ostr, const std::pair<Container1&, Container2&> data) |