#computationalgeometry
Explore tagged Tumblr posts
philearning · 5 years ago
Photo
Tumblr media
INTRODUCTION TO ALGORITHMS - The third edition has been revised and updated throughout. It includes two completely new chapters, on van Emde Boas trees and multithreaded algorithms, and substantial additions to the chapter on recurrences (now called “Divide-and-Conquer”). Self-direct your studies with an exhaustive range of academic Textbooks Collection of PHI Learning Buy Now: https://bit.ly/3gN4HtA #Algorithms #Engineering #BinarySearchTrees #ComputationalGeometry #GraphAlgorithms https://www.instagram.com/p/CBBjpBeHxF1/?igshid=pt4jnersyhfj
0 notes
sinamostafavi · 8 years ago
Photo
Tumblr media
Bench to wall to..., 1 to 10 tight and seamless 3D printed prototype with varied interlocked components #Workinprogress result of our design computation to materializations workshop #designstudio #d2rp #robotsinarchitecture #bkcity #designtoproduction #roboticbuilding #SinaMostafavi #AndreaCosta #OscarBorgström #RebeccaLopesCardozo #TheonaKessaris #architecture #nextarch #superarchitects #porosity #urbanfurniture #prototyping #architecturalrobotics #designresearch #3dprinting #3dprint #ultimaker #additivemanufacturing #computationaldesign #computationalgeometry (at Amsterdam, Netherlands)
0 notes
amazingdraft · 12 years ago
Text
Angle between three points
Once I had to write some code (C++) related to computational geometry involving triangles and meshes (the goal was a Delaunay triangulation). One of the first codes was to find the angle given three points.
The main idea was: read three points (six pair of coordinates) and calculate the internal angle of this triangle formed by this three points.
So, the question is: how to find the angle between two vectors? A little math is needed here.. specifically in the dot product, which can be written as:
,
where θ is the angle formed by the vectors |A| and |B| their magnitude:
Now we can find θ:
To find α, β and θ of the first Figure, we have to calculate the magnitude of the three vectors:
Finally, the angles:
Remember: these angles are in radian. To pass to degree we have to multiply by 180 and divide by π.
Here is the C/C++ code:
#include <stdio.h> #include <math.h> double getMagnitude(int x1, int x2, int y1, int y2) { double aux = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2); return sqrt(aux); } double getAngle(int x1, int x2, int x3, int y1, int y2, int y3, double V1, double V2) { double aux = ((x2-x1)*(x3-x1) + (y2-y1)*(y3-y1))/(V1*V2); return acos(aux); } double rad2deg(double angle) { return angle*180/3.1415; } int main(int argc, char *argv[]) { // Coordinates int x1=10, y1=10; int x2=50, y2=10; int x3=10, y3=40; // STEP 1: Magnitude of vectors A, B and C double A = getMagnitude(x2,x3,y2,y3); double B = getMagnitude(x3,x1,y3,y1); double C = getMagnitude(x1,x2,y1,y2); // STEP 2: Angles alpha(C-B) beta(A-B) theta(C-A) double alpha = getAngle(x1,x2,x3,y1,y2,y3,C,B); double beta = getAngle(x3,x2,x1,y3,y2,y1,A,B); double theta = getAngle(x2,x1,x3,y2,y1,y3,C,A); // STEP 3*: Radian to degree alpha = rad2deg(alpha); beta = rad2deg(beta); theta = rad2deg(theta); printf("alpha: %lf\nbeta: %lf\ntheta: %lf\n",alpha,beta,theta); }
You should get this values:
0 notes
sinamostafavi · 8 years ago
Photo
Tumblr media
Multidirectional 3D Printed node. Work in progress, beyond the complexity of morphology of the nodes, challenge was to establish a method to compute and generate multidirectional components result of our design computation to materializations workshop #designstudio #d2rp #robotsinarchitecture #bkcity #designtoproduction #roboticbuilding #sinamostafavi #EdwinVermeer #HeeyounKim #SjoerddeRoij #TimeaSándor, #YamohRasa #architecture #nextarch #superarchitects #porosity #urbanfurniture #prototyping #architecturalrobotics #designresearch #3dprinting #3dprint #ultimaker #additivemanufacturing #computationaldesign #computationalgeometry (at Amsterdam, Netherlands)
0 notes