Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: RFC: 8-topology system
Home

[Freeciv-Dev] Re: RFC: 8-topology system

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: RFC: 8-topology system
From: Jason Dorje Short <vze2zq63@xxxxxxxxxxx>
Date: Tue, 16 Oct 2001 23:44:07 -0400
Reply-to: jdorje@xxxxxxxxxxxx

Raimar Falke wrote:
> 
> On Tue, Oct 16, 2001 at 06:22:35PM -0400, Jason Dorje Short wrote:
> > Raimar Falke wrote:
> > >

> > > I think that another shape is good. This may be of no real use but it
> > > allows use to test the code. And a non-isometric ellipse has the
> > > semantics of most north <=> y=0. Also such an ellipse will also have
> > > non-real tiles in the rectangular xsize*ysize.

> > >                               C
> > >                     # # # # # # # # # # #
> > >               # # # # # # # # # # # # # # # # #
> > >             # # # # # # # # # # # # # # # # # # #
> > >           # # # # # # # # # # # # # # # # # # # # #
> > >         # # # # # # # # # # # # # # # # # # # # # # #
> > >       # # # # # # # # # # # # # # # # # # # # # # # # #
> > >       # # # # # # # # # # # # # # # # # # # # # # # # #
> > >       # # # # # # # # # # # # # # # # # # # # # # # # #
> > >     A # # # # # # # # # # # # # # # # # # # # # # # # # B
> > >       # # # # # # # # # # # # # # # # # # # # # # # # #
> > >       # # # # # # # # # # # # # # # # # # # # # # # # #
> > >       # # # # # # # # # # # # # # # # # # # # # # # # #
> > >         # # # # # # # # # # # # # # # # # # # # # # #
> > >           # # # # # # # # # # # # # # # # # # # # #
> > >             # # # # # # # # # # # # # # # # # # #
> > >               # # # # # # # # # # # # # # # # #
> > >                     # # # # # # # # # # #
> > >                               D

> This figure was done with:
> ------
> a=13
> b=9
> 
> for y in range(-10,11):
>     for x in range(-15,16):
>         if x*x*b*b+a*a*y*y<=a*a*b*b:
>             print "#",
>         else:
>             print " ",
>     print

int main(int argc, char** argv)
{
        int a, b;
        int x, y;

        if (argc != 3)
                printf("Ugh.\n");

        sscanf(argv[1], "%d", &a);
        sscanf(argv[2], "%d", &b);
        
        a++;
        b++;

        for (y = -b; y<=b; y++) {
                for (x = -a; x <= a; x++) {
                        char c = ' ';
                        if (x*x*b*b + y*y*a*a < a*a*b*b)
                                c = '#';
                        printf("%c ", c);
                }
                printf("\n");
        }
}




[jshort@jason freeciv]$ gcc test.c 
[jshort@jason freeciv]$ ./a.out 13 9
                                                          
                # # # # # # # # # # # # #                 
            # # # # # # # # # # # # # # # # #             
          # # # # # # # # # # # # # # # # # # #           
      # # # # # # # # # # # # # # # # # # # # # # #       
    # # # # # # # # # # # # # # # # # # # # # # # # #     
    # # # # # # # # # # # # # # # # # # # # # # # # #     
  # # # # # # # # # # # # # # # # # # # # # # # # # # #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # #   
    # # # # # # # # # # # # # # # # # # # # # # # # #     
    # # # # # # # # # # # # # # # # # # # # # # # # #     
      # # # # # # # # # # # # # # # # # # # # # # #       
          # # # # # # # # # # # # # # # # # # #           
            # # # # # # # # # # # # # # # # #             
                # # # # # # # # # # # # #                 
                                                          
[jshort@jason freeciv]$ 

Attached is a 40x20 (really 80x40) ellipse.


Now, the next question: iso-ellipses.  Obviously we need them, but the
math will be even trickier.  Do we have an ellipse inside an
iso-rectangle inside a flat rectangle (which is what's done for
iso-rectangles), or do we try to plant the ellipse directly within the
rectangle?

jason
                                                                                
                                                                                
      
                                                          # # # # # # # # # # # 
# # # # # # # # # # # # # #                                                     
      
                                                # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # #                                           
      
                                        # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # #                                   
      
                                  # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # #                             
      
                              # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # #                         
      
                          # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #                     
      
                      # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #                 
      
                  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #             
      
                # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #           
      
              # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #         
      
          # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #     
      
        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #   
      
        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #   
      
      # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
      
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
#     
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
#     
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# #   
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# #   
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
#     
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
#     
      # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
      
        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #   
      
        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #   
      
          # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #     
      
              # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #         
      
                # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #           
      
                  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #             
      
                      # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #                 
      
                          # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #                     
      
                              # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # #                         
      
                                  # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # #                             
      
                                        # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # #                                   
      
                                                # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # #                                           
      
                                                          # # # # # # # # # # # 
# # # # # # # # # # # # # #                                                     
      
                                                                                
                                                                                
      

[Prev in Thread] Current Thread [Next in Thread]