Created
December 3, 2017 01:08
-
-
Save JSiapo/9cafa5968b63fa8d1817725be63f214d to your computer and use it in GitHub Desktop.
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
void circuGeneral(GLint xc, GLint yc, GLint r){ | |
int x; | |
double y1,y2; | |
for(x=xc-r;x<=xc+r ;x+=1){ | |
y1=yc+sqrt(r*r-((x-xc)*(x-xc))); | |
cout<<"y: "<<y1<<"\t"; | |
y2=yc-sqrt(r*r-((x-xc)*(x-xc))); | |
pintarPixel(x,roundf(y1)); | |
pintarPixel(x,roundf(y2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Algoritmo de la ecuación general para circunferencia (función con Opengl).