Skip to content

Instantly share code, notes, and snippets.

@JSiapo
Created December 3, 2017 01:08
Show Gist options
  • Save JSiapo/9cafa5968b63fa8d1817725be63f214d to your computer and use it in GitHub Desktop.
Save JSiapo/9cafa5968b63fa8d1817725be63f214d to your computer and use it in GitHub Desktop.
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));
}
}
@JSiapo
Copy link
Author

JSiapo commented Dec 3, 2017

Algoritmo de la ecuación general para circunferencia (función con Opengl).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment