my code stock.com

Programa de graficos1

Snippet options

Download: Download snippet as graficos1.cpp.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

/*
  Name: Trazo de líneas y figuras geométricas.
  Copyleft: Creative Commons. 
  Authors: Cureño Alva E. ,Lopez Perez F.
  Date: 15/04/15 22:17
  Description:  Muestra el modo de emplear las funciones: 
                circle, ellipse, fillellipse ,line,lineto
                rectangle, sector , arc
*/

#include <graphics.h>

using namespace std;

int main( )
{
    
    
	initwindow( 1350 , 700 , "WinBGIm" );
    
    for(int i = 1; i <= 3; i++)
    {
        line( (getmaxx()/4) * i ,0 ,(getmaxx()/4) * i ,getmaxy());   
    }	
    
    line( 0,getmaxy()/2,getmaxx(),getmaxy()/2);
    
    //----figuras-----------------------------
 
    outtextxy (5,5,"Funcion circle");
    circle(getmaxx()/8,getmaxy()/4,getmaxx()/16);
    
    outtextxy ((getmaxx() * 1 )/4 + 5, 5 ,"Funcion ellipse");
    ellipse((getmaxx() * 3 )/8  ,getmaxy()/4 , 0, 360, getmaxx()/16, getmaxy()* 3/64);
    
    outtextxy ((getmaxx() * 2 )/4 + 5, 5 ,"Funcion fillellipse");
    fillellipse((getmaxx() * 5 )/8  ,getmaxy()/4 ,getmaxx()/16, getmaxy()* 3/64);
    
    outtextxy ((getmaxx() * 3 )/4 + 5 , 5 ,"Funcion line");
    line((getmaxx() * 13 )/16  ,getmaxy()/8 ,(getmaxx() * 15)/16, (getmaxy()* 3)/8);
    
    outtextxy ( 5, getmaxy()/2 + 5,"Funciones moveto y lineto");
    moveto((getmaxx() * 1)/16,(getmaxy()*5)/8);
    lineto((getmaxx() * 3)/16,(getmaxy()*7)/8);  
    
    outtextxy ((getmaxx() * 1 )/4 + 5, getmaxy()/2 + 5,"Funcion rectangle");  
    rectangle( (getmaxx() * 5)/16,(getmaxy()*5)/8 ,(getmaxx() * 7)/16,(getmaxy()*7)/8 );
    
    outtextxy ((getmaxx() * 2 )/4 + 5, getmaxy()/2 + 5,"Funcion sector");
    sector((getmaxx() * 5)/8,(getmaxy() * 3)/4 , 0, 270, getmaxx()/16, getmaxy()* 3/64);
    
    outtextxy ((getmaxx() * 3 )/4 +5, getmaxy()/2 + 5,"Funcion arc");
    arc ((getmaxx() * 7)/8, (getmaxy() * 3)/4,0, 180, getmaxx()/16);
        
    while(!kbhit());
	closegraph( );
	return( 0 );
}

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.