Skip to content

Instantly share code, notes, and snippets.

View Abacn's full-sized avatar

Yi Hu Abacn

View GitHub Profile
@Abacn
Abacn / ellipse.cpp
Last active June 13, 2019 21:51
Minimum Distance of a point to the boundary of an ellipse
//
// ellipse.cpp
// EllipticalCylinder
//
// Created by Yi Hu on 4/6/18.
//
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <nlopt.h>
@Abacn
Abacn / opttest.py
Created September 22, 2017 04:26
Modulo Operation in python is much slower than +-x/
#!/usr/bin/python
# python 2.7.11 on windows 10 x64. CPU-Intel i7-6700k
import numpy as np
import time
N = 100
M = 100000
V = 10
coords = [[]]*N
for i in range(N):