-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential geometry things to add #137
Labels
Comments
This a nice goal.
We sort of have this in the number theory chapter (modsum). |
Tangent Circle Idea: typedef pair<P, P> Line
// Returns the center of the tangent circle
P tangentCircle(Line a, Line b, double r) {
P o = intersect(a, b);
double agl = (b - o).angle() - (a - o).angle()
// Normalize this
if(agl > PI) agl = 2 * PI - agl;
P middle = a; middle.rotate(agl);
// If this method fails, lets just do (a - o).unit() + (b - o).unit()
middle = middle.unit() * (r / sin(agl / 2));
return middle;
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd like to cram as much geometry as possible into KACTL. Perhaps not necessarily included by default, but some of these things would be nice to have. Taking lots of these from https://github.com/spaghetti-source/algorithm/tree/master/geometry
The text was updated successfully, but these errors were encountered: