Index: trunk/tools/nautical.py
===================================================================
--- trunk/tools/nautical.py	(revision 2644)
+++ trunk/tools/nautical.py	(revision 2645)
@@ -29,4 +29,5 @@
 # safewater_buoy1: Function to draw a safe water mark buoy using buoy1
 # special_buoy1: Function to draw an special mark buoy using buoy1
+# yboat: Function to define an schematic boat from the y-plane
 # z_boat: Function to define an schematic boat from the z-plane
 # zsailing_boat: Function to define an schematic sailing boat from the z-plane with sails
@@ -55,4 +56,132 @@
 
 # FROM: http://www.photographers1.com/Sailing/NauticalTerms&Nomenclature.html
+def yboat(length=10., flength=0.7, freeboard=2., hskeg=2.,fskeg=0.2,  N=200):
+    """ Function to define an schematic boat from the y-plane
+      length: length of the boat (without stern, default, 10)
+      flength: floating length of the boat as percentage of length (defatult, 0.7)
+      freeboard: height above the water (default, 2)
+      hskeg: height of the skeg (default, 2)
+      fskeg: length of the skeg as percentage of length (default, 0.2)
+      N: number of points to use (default, 200)
+    """
+    fname = 'yboat'
+
+    lflength = length*flength
+    ilf3 = length*(1.-flength)/3
+
+    bow = np.array([length, freeboard])
+    hbow = np.array([lflength + ilf3, 0.])
+    sternp = np.array([0., freeboard])
+    sternlp = np.array([0., freeboard*0.8])
+
+    boat = np.zeros((N,2), dtype=np.float)
+    N1 = int(N*0.8)
+    N2 = N - N1 - 1
+
+    # stern
+    N14 = N1/4
+    stern = np.zeros((N14,2), dtype=np.float)
+    ipt = hbow
+    ept = bow
+    dy = (ept[0] - ipt[0])/(N14-1)
+    dz = (ept[1] - ipt[1])/(N14-1)
+    for ip in range(N14):
+        stern[ip,:] = ipt + [dy*ip, dz*ip]
+
+    # deck
+    deck = np.zeros((N14,2), dtype=np.float)
+    ipt = bow
+    ept = sternp
+    dy = (ept[0] - ipt[0])/(N14-1)
+    dz = (ept[1] - ipt[1])/(N14-1)
+    for ip in range(N14):
+        deck[ip,:] = ipt + [dy*ip, dz*ip]
+
+    # sternl
+    sternl = np.zeros((N14,2), dtype=np.float)
+    ipt = sternp
+    ept = sternlp
+    dy = (ept[0] - ipt[0])/(N14-1)
+    dz = (ept[1] - ipt[1])/(N14-1)
+    for ip in range(N14):
+        sternl[ip,:] = ipt + [dy*ip, dz*ip]
+
+    # keel
+    N12 = N1 - 3*N14
+    keel = geo.circ_sec(sternlp, hbow, length, arc='short', pos='left', Nang=N12)
+
+    # skeg
+    lskeg = length*fskeg
+    ilk3 = length*(1.-fskeg)/3
+    iuskeg = np.array([1.5*ilk3, 0.])
+    euskeg = np.array([1.5*ilk3+lskeg, 0.])
+    edskeg = np.array([1.5*ilk3+lskeg*0.8, -hskeg])
+    idskeg = np.array([1.5*ilk3+lskeg*0.3, -hskeg])
+
+    skeg = np.zeros((N2,2), dtype=np.float)
+    N24=N2/4
+
+    # upper skeg
+    uskeg = np.zeros((N24,2), dtype=np.float)
+    ipt = iuskeg
+    ept = euskeg
+    dy = (ept[0] - ipt[0])/(N24-1)
+    dz = (ept[1] - ipt[1])/(N24-1)
+    for ip in range(N24):
+        uskeg[ip,:] = ipt + [dy*ip, dz*ip]
+
+    # aft skeg
+    askeg = np.zeros((N24,2), dtype=np.float)
+    ipt = euskeg
+    ept = edskeg
+    dy = (ept[0] - ipt[0])/(N24-1)
+    dz = (ept[1] - ipt[1])/(N24-1)
+    for ip in range(N24):
+        askeg[ip,:] = ipt + [dy*ip, dz*ip]
+
+    # down skeg
+    dskeg = np.zeros((N24,2), dtype=np.float)
+    ipt = edskeg
+    ept = idskeg
+    dy = (ept[0] - ipt[0])/(N24-1)
+    dz = (ept[1] - ipt[1])/(N24-1)
+    for ip in range(N24):
+        dskeg[ip,:] = ipt + [dy*ip, dz*ip]
+
+    # stern skeg
+    N22 = N2 - 3*N24
+    sskeg = np.zeros((N22,2), dtype=np.float)
+    ipt = idskeg
+    ept = iuskeg
+    dy = (ept[0] - ipt[0])/(N22-1)
+    dz = (ept[1] - ipt[1])/(N22-1)
+    for ip in range(N22):
+        sskeg[ip,:] = ipt + [dy*ip, dz*ip]
+
+    boat[0:N14,:] = stern
+    boat[N14:2*N14,:] = deck
+    boat[2*N14:3*N14,:] = sternl
+    boat[3*N14:4*N12,:] = keel
+    boat[N1,:] = np.array([gen.fillValueF, gen.fillValueF])
+    boat[N1+1:N1+1+N24,:] = uskeg
+    boat[N1+1+N24:N1+1+2*N24,:] = askeg
+    boat[N1+1+2*N24:N1+1+3*N24,:] = dskeg
+    boat[N1+1+3*N24:N,:] = sskeg
+
+    # correct order of sections
+    boatsecs = ['stern', 'deck', 'sternl', 'keel', 'uskeg', 'askeg', 'dskeg', 'sskeg']
+
+    # dictionary with sections [polygon_vertices, line_type, line_color, line_width]
+    dicboat = {'stern': [stern, '-', '#8A5900', 2.],                         \
+      'deck': [deck, '-', '#8A5900', 2.],                                  \
+      'sternl': [sternl, '-', '#8A5900', 2.],                                          \
+      'keel': [keel, '-', '#8A5900', 2.],                        \
+      'uskeg': [uskeg, '-', '#000000', 1.5], 'askeg': [askeg, '-.', '#000000', 1.5], \
+      'dskeg': [dskeg, '-', '#000000', 1.5], 'sskeg': [sskeg, '-.', '#000000', 1.5]}
+
+    boat = ma.masked_equal(boat, gen.fillValueF)
+      
+    return boat, boatsecs, dicboat
+
 def zboat(length=10., beam=1., lbeam=0.4, sternbp=0.5):
     """ Function to define an schematic boat from the z-plane
