Results 1 to 10 of 25

Thread: August/September Entry: Portolan Chart

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Default

    Cleaned up extraneous rhumb lines and rotated them slightly, and added a neatline.

    ### LATEST WIP ###

    Click image for larger version. 

Name:	aug-sept-outline.png 
Views:	173 
Size:	419.3 KB 
ID:	28251

  2. #2
    Guild Member sigurdbjohansson's Avatar
    Join Date
    Aug 2010
    Location
    Oslo, Norway
    Posts
    88

    Default

    hello you... any chance you`d share that little rhumb program?? me wants it very bad!
    -Sigurd Sigurd Brutus Motor-



  3. #3
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Default

    Quote Originally Posted by sigurdbjohansson View Post
    hello you... any chance you`d share that little rhumb program?? me wants it very bad!
    Code:
    #!/usr/bin/ruby1.9.1
    
    require 'matrix'
    
    p=4
    
    n=2**p
    
    d1=600
    d2=4*d1
    
    
    
    points=Array.new(n) do |k|
      theta=2*Math::PI*k/n
      
      x=d1*Math.cos(theta)
      y=d1*Math.sin(theta)
    
      Vector[x,y]
    end
    
    def line(p1,p2,style)
      "<path d=\"M#{p1.to_a.join " "} L#{p2.to_a.join " "}\" style=\"#{style}\" />"
    end
    
    puts <<EOS
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    
    <svg version="1.1"
    xmlns="http://www.w3.org/2000/svg">
    EOS
    
    n.times do |k|
      p1=points[k]
      (k...n).each do |l|#<path d="M250 150 L150 350 L350 350 Z" />
        style=(k+l)%2==0? "stroke:black;stroke-width:0.5px;":"stroke:red;stroke-width:0.5px;"
    
        opacity="opacity:#{rand*0.5+0.5}"
        p2=points[l]
        v=p1-p2
        v=v*d2*(1.0/v.r)
        p3=p1+v
        p4=p2-v
    
        # p4 - p2 - p1 - p3
    
        print line(p1, p2, style+opacity)
        
        print line(p4, p2, style+opacity)
        
        puts line(p1, p3, style+opacity)
    
      end
      style="stroke:black;stroke-width:0.5px;"
    
      theta=2*Math::PI*(k+n/4)/n
    
      x=d2*Math.cos(theta)
      y=d2*Math.sin(theta)
    
      v=Vector[x,y]
      
      p2=p1+v
      p3=p1-v
    
      opacity="opacity:#{rand*0.5+0.5}"
    
      print line(p1, p2, style+opacity)
      puts line(p1, p3, style+opacity)
      
    end
    
    puts "</svg>"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •