Need 3D functions for Uhden Boom Vang

Need 3D functions for Uhden Boom Vang

john.uhden
Mentor Mentor
6,739 Views
58 Replies
Message 1 of 59

Need 3D functions for Uhden Boom Vang

john.uhden
Mentor
Mentor

I haven't seen one of these contraptions anywhere, but I am imagining it.

 

UhdenVang.jpg

The goal is that by tightening the vang (from either side of the boat), not only do you pull the boom down but also pull it forward to optimize the sail shape and outward position mainly on a run.  Conventional vangs attached to the base of the mast don't pull the boom forward.

Rather than trial and error by drawing the thing a number of times with the boom in or out, I want to calculate the height above the deck.  I am pretty sure that the XY force vector is the bisector of the two legs of the vang, but calculating the Z will indicate to me the relative downward pull that the vang will exert on the boom at its point of attachment to the boom.  With this daydream design, I am assuming that the closer hauled the sail (boom being almost midships) that the downward pull will be the minimum, which is what you want when sailing upwind because the mainsheet should control the downward pull in that condition.

Anyone got any functions that will help me calculate the Z for various boom angles and tightness on the vang?

My premonition is that the force directions are simple (x y z) vectors and that the Z value is just a matter of applying the sine of the vertical part of the vector.  But I could spend days on this and spin myself in circles (just like many sailors do on the water after they have fouled another boat.)  I would like to build and use it (if it mathematically works) before the end of the racing season, just three weeks away.  Even better for the next races this coming Friday.

Now it's probably not that important because I lapped the rest of the fleet twice in the last race.  I'm not a sore loser, but winning is fun.

For those of you who have read this far and are familiar with yacht racing rules, for fun I suggested to the committee that the 360° penalty is too severe and should be cut in half.😆

John F. Uhden

0 Likes
Accepted solutions (1)
6,740 Views
58 Replies
Replies (58)
Message 41 of 59

hak_vz
Advisor
Advisor

@john.uhden  I have been searching the web to get familiar with the this topic, and have stumbled on a document in attachment. I hope there are some formulas you may find useful.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 42 of 59

john.uhden
Mentor
Mentor

That's very kind of you.

Section 4.1.4 and Figure 1.5 cover vangs, but some of the variables in the formulas are not graphically displayed.

I think my approach of solving for the maximum Z of the boom for various horizontal angles is indicative enough.  The shorter the Z, the more the force (tighter).

John F. Uhden

0 Likes
Message 43 of 59

leeminardi
Mentor
Mentor

As I mentioned earlier I am not a sailor and not that familiar with its rigging.  I feel I know engineering mechanics of statics fairly well and was struck by your statement "...The shorter the Z, the more the force (tighter)." which I thought counter to my understanding of the configuration.

 

The following is a simple free body diagram of the forces acting on the boom.   As I see it the wind creates a moment about the mast.  In actuality this is 3D but its ok to assume 2D for this discussion.   In the sketch below, Case #1 has the force of Vang perpendicular to the boom and in case #2 it is at an angle of 30°.  As can be seen the force in the Vang line is greater as the angle gets smaller.

 

 

 

image.png

Looking at the following equation from section 4.1.4:

 

leeminardi_0-1598024192693.png

we can see that FV increase as alpha gets smaller.

 

I think the force FV increases as the line gets longer not shorter.

 

Of course, I may be misinterpreting the geometry.

 

Can you post a 3D CAD model of the basic layout?

 

Lee

lee.minardi
0 Likes
Message 44 of 59

john.uhden
Mentor
Mentor

Lee:

Thanks for the lesson.

The simplistic idea I have is that the vang rope, once adjusted, remains at a fixed length until manually readjusted.

For this nonconventional design, the Z value of P3 must change as the boom is let out in order to adhere to the vang length.  Thanks to the elliptical path of P3, the Z value at midships calculates to be less than when the boom is out (almost perpendicular to boat centerline).  I don't want there to be much of a difference as it might impede the boom from crossing over midships on a gybe.  But I am looking for a forward vector that passes by the side of the mast, not directly at it as a conventional vang does.  I really don't care about the real forces.  I have a good idea what type and diameter rope to use that will withstand forces beyond reality.  It would have to be a gale force wind to break any spars.

Here... play with my approximated VANG.lsp.  Use architectural units and start with L=48", X=-3", and offset=3".

The height of the gooseneck above the deck is fixed in the program at 12".

The results are a list of values...

(boom angle _ vector angle _ length of vang _ Z _ alpha)

Remember that I changed the design so that the P3 block is attached to the boom without any additional lines.

(defun c:vang ( / p0 p1 p2 p3 p4 p5 -bang ang L L1 H A B C A! B! C! Z)
 (setq ok nil)
  (defun @dtor (ang)(* (/ ang 180.0) pi))
  (defun @midp (p1 p2)
     (mapcar '* '(0.5 0.5 0.5)(mapcar '+ p1 p2))
  )
  (defun @Anonymous (a1 a2)
    (cond
      ((> a1 (+ a2 pi))
        (+ a2 pi pi (- a1))
      )
      ((> a2 (+ a1 pi))
        (- a2 a1 pi pi)
      )
      (1 (- a2 a1))
    )
 )
 (defun @Anonymous (p)(list (car p)(cadr p)))
 (defun @Anonymous (p z)(list (car p)(cadr p) z))
 (defun @Anonymous (sine / cosine)
     (setq cosine (sqrt (- 1.0 (expt sine 2.0))))
     (if (zerop cosine)(setq cosine 1e-16))
     (atan (/ sine cosine))
 )
 (initget 7)
 (setq offset (getreal "\nDeck block offset: "))
 (initget 1)
 (setq X (getreal "\nEnter deck block X: "))
 (initget 7)
 (setq L (getreal "\nVang rope length: "))
 (setq p0 '(0.0 0.0 12.0)
           p1 (list X offset 0.0)
           p2 (mapcar '* '(1 -1 1) p1)
           L1 18.0
           H 12.0
           mrad 0.75 ;; mast radius
           results nil
           ok 0
 )
 (foreach bang° '(0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 89.9)
    (setq bang (@dtor bang°)
               p3 (polar p0 bang L1)
    )
    (if (<= bang (angle p2 p0))
      (setq ang (angle p3 (@midp p1 p2))
                 p4 (polar p3 ang 100)
                 ok 1
      )
      (setq ang (angle p3 (@midp p1 p0))
                 p4 (polar p3 ang 100)
                 ok 1.5
      )
    )
    (if (> bang  (angle p2 p0))
      (setq angb (angle p0 p3)
                 angc (angle p2 p0)
                 p (polar p0 (* 0.5 (+ angb angc)) mrad)
      )
      (setq p p2)
    )
    (setq ok 5)
    (if (> bang (angle p2 p0))
      (setq ang (* 0.5 (+ (angle p3 p1)(angle p3 p)))
                 p4 (polar p3 ang 100.0)
      )
      (setq ang (* 0.5 (+ (angle p3 p1)(angle p3 p2)))
                 p4 (polar p3 ang 100.0)
      )
    )
    (setq Z H
               p3 (@3d p3 H)
               A! (distance p1 p3)
               B! (distance p p3)
               C! 0.0
    )
    (setq ok 6)
    (while (not (equal (+ A! B! C!) L 0.001))
        (if (> bang (angle p2 p0))
          (setq C (distance p2 (@2d p))
                     B (distance (@2d p)(@2d p3))
                     p5 (@3d p (* Z (/ C (+ C B))))
                     C! (distance p2 p5)
                     B! (distance p5 p3)
          )
        )
        (setq alpha (@asin (/ (- Z H) L1))
                   ok 6.1
                   fract (/ L (+ A! B! C!))
                   ok 6.2
                   Z (* Z fract)
                   ok 6.3
                   p3 (@3d p3 Z)
                   L1 (distance (@2d p0)(@2d p3))
                   ok 6.4
        )
        (if (> bang (angle p2 p0))
          (setq p5 (@3d p (* Z (/ C (+ C B))))
                     C! (distance p2 p5)
                     B! (distance p5 p3)
                     A! (distance p1 p3)
          )
          (setq A! (distance p1 p3)
                     B! (distance p2 p3)
                     C! 0.0
          )
        )
  ;;      (if (< ok 7) (print (list (angtos bang 1 0)(angtos (- ang pi) 0 3) (+ A! B! C!) fract Z)))
        (setq ok 7)
      )
      (setq results (cons (list (angtos bang 1 0)(angtos (- ang pi) 1 0) (+ A! B! C!) Z (angtos alpha 1 0)) results) ok 8)
    )
  (princ (strcat "\nDeck block offset: " (rtos offset 4 2)))
  (princ (strcat "\nVang length: " (rtos L 4 2)))
  (mapcar 'print (reverse results))
  (princ (strcat "\nVertical range: " (rtos (- (apply 'max (mapcar '(lambda (x)(nth 3 x)) results)) (apply 'min (mapcar '(lambda (x)(nth 3 x)) results)) ) 4 3)))
  (setq ok 10)
  (princ)
)
 

John F. Uhden

0 Likes
Message 45 of 59

diagodose2009
Collaborator
Collaborator

Eu am nevoie de ajutor IT/developer. Deja eu am lucrat 3ore pentru recuperarea ecuatiilor matematice (eng=recover mathEquations) pentru Java-Applets.

Tu vizionezi fisierul pp_johnboomvang.txt , attached here.

Please help, Tu repara ecuatiile din fisierul pp_johnboomvang.txt atasat aici

You see, i compile pp_johnboomvang.txt to autovang.lsp.

 

Edited by
Discussion_Admin

 

0 Likes
Message 46 of 59

john.uhden
Mentor
Mentor
My apologies (I'm sorry) but I don't understand what appears to be Spanish.
I learned some French in high school but not very well.
I can translate "cut the grass" to French... "mow ze lawn."

John F. Uhden

0 Likes
Message 47 of 59

leeminardi
Mentor
Mentor

With reference to the P3 that you refer to, how does that differ from P1 in the image below? I assume that you have removed the line B3 to p1 and B3 is now at P1.

image.png

You state that "the Z value of P3 must change as the boom is let out".  I'm not sure i understand why that should be unless the mast is not perpendicular to the deck or the billow of the sail changes.  Is this the case?

 

I'll try out your program when I have a chance.

 

Lee

lee.minardi
0 Likes
Message 48 of 59

john.uhden
Mentor
Mentor

Here's an up-to-date image showing both conditions.

 

John F. Uhden

0 Likes
Message 49 of 59

leeminardi
Mentor
Mentor

No image attached.

lee.minardi
0 Likes
Message 50 of 59

john.uhden
Mentor
Mentor

UhdenVang.jpg

John F. Uhden

0 Likes
Message 51 of 59

leeminardi
Mentor
Mentor

@john.uhden 

I'd like to try out your program.  What are reasonable input values for:

  1. Deck block offset, and is this 1/2 the distance from P1 to P2?
  2. Deck block X, and is the distance from P0 to the line P1P2 on the XY plane? Is this a negative number?
  3. Vang rope length.

What does the variable H represent?

 

It looks like you assume that P3 has the same Z as P0.  This assumes the boom is 90° to the mast.  Is this always the case?

 

I'd like to solve this in 3D using vector math.  What would you like for output?

 

 

 

lee.minardi
0 Likes
Message 52 of 59

john.uhden
Mentor
Mentor

The Offset is from the centerline of the boat (mast) to each deck block in the Y direction, so yes it is half the distance from P1 to P2.

The X value is the fore and aft location of the deck blocks from the mast.  A negative value would be toward the bow and a positive value would be toward the stern.  I have presumed that the value wants to be negative in order to maintain a forward vector force.

P3 is the 3D location of the block attached to the boom.  P3 will rotate horizontally about the mast as the boom is hauled in or let out.  The vertical component of P3 will vary with the boom angle due to the constraint imposed by the vang.

L is the 3D length of the vang from P1 to P3 to P2, or from P1 to P3 to P to P2, depending on whether the boom is out far enough that the vang wraps around the mast to get from P2 to P3.

H is the height off the deck of the gooseneck (where the boom meets the mast).  Although you could change the rigging to set the sail higher or lower, it something you would have to do with the sail down on land or at least calm water before a race, which is rarely done, so it remains constant while sailing

The idea of the vang is that you adjust its length to achieve the visually desirable height of the boom at P3, which makes for the sail being fuller or flatter.  Tightening the vang makes it shorter which will decrease the Z value of P3.  Note also that the tension on the vang from P1 to the cleat is only a fraction of the vector force, thus providing mechanical advantage, aka purchase.  Actually, tightening the vang from either P1 or P2 accomplishes the same thing, which enables the adjustment from either side of the boat.  The side of the boat you sit on depends on the wind velocity to maintain an even keel (tilt).

Anyway, P3 is rarely the same elevation as P0, and due to the shape of the sail P3 should probably always be higher than P0.

In my code I

(setq P0 '(0 0 12))

and afterward

(setq H 12)

Technically, I should have first

(setq H 12)

and then

(setq P0 (list 0 0 H))

Note that I included your alpha because you felt it important.  I am looking rather at the Z value of P3 relative to H.

Due to the triangular lateen rig it's probably not possible to get Z lower than H (negative alpha) without bending the mast excessively at the deck, which could create a nasty crunching or snapping sound like the kind you don't want to hear when hang gliding.  😕  In sailing the rig just ends up in the water.  In hang gliding the rig ends up crashing to earth (with you attached).  So except for the boom likely hitting you in the head (gotta duck), I'd say that sailing is a bit safer, even though you probably can't drown in the sand.  Oh, but hey, you could land in the ocean.

Reasonable inputs:

Offset:  1 to 12 inches

X:  -1 to -10 inches

L:  45 to 65 inches, depending on X and Offset

John F. Uhden

0 Likes
Message 53 of 59

leeminardi
Mentor
Mentor

Thanks @john.uhden .  That helps me understand the rigging configuration.

 

Determining if the Vang hits the mast is easy by just taking the dot product of a vector from P0 to P3 with the cross product of the mast's centerline vector and the vector from P2 to P3..  If the result is less than the mast's radius then the Vang hits the mast.  This calculation does not take into account which side of the mast the vang is on so an additional calculation needs to be done.  I have to give that some thought.

Can I ignore the size of the mast's radius if the vang wraps around the mast and just assume the vang goes through the mast's center where it bends? 

 

It looks like the weather today will be too nice to spend time on the computer so I will get to this later.

 

lee.minardi
0 Likes
Message 54 of 59

john.uhden
Mentor
Mentor
I would not ignore the mast diameter. If this daydream comes true, it
might possibly be used on other yachts with fatter masts, at which point I
would even include computing the arc length of the wrap.
I am compressed by your knowledge of vectors, but my simplistic use of
distances and angles does seem to work, right?

John F. Uhden

0 Likes
Message 55 of 59

leeminardi
Mentor
Mentor

Hi @john.uhden  

I took some time to study your code and learned a few vlisp programming tips.  I also found that your program does not keep the distance from p0 to p3 to the specified value of 18. 

 

The attached code calculates the position of p3 while keeping the p0p3 distance constant and the rope length accurate to 4 decimal places.  To simplify the debugging process I did not include your foreach loop.  I figure you can modify the output data to suit your needs. If this looks good I will start working on the mast interference part of the program.

 

In the image below the green line is the vang for beta = 0°, and the magenta line for beta = 30°.  Both are 65.0000 long. The red line is a horizontal line  18 long in the x direction I used as a reference.

image.png

 

(defun c:vang ( / p0 p1 p2 p3 p4 p5 -bang ang L L1 H A B C A! B! C! Z)
; calculates the position of P3 given:
; the deck block offset, x value, rope length, and boom angle beta
; assumes mast postion, boom height and distance to p3 from mast.
; assumes vang does not interfere with mast.  
; L. Minardi 8/24/2020   draft version 1.0
;  
(setvar "osmode" 0)
(command "pdmode" 35)  
  (setq ok nil)
  (defun @dtor (ang)(* (/ ang 180.0) pi))
  (defun @midp (p1 p2)
     (mapcar '* '(0.5 0.5 0.5)(mapcar '+ p1 p2))
  )

 (initget 7)
 (setq offset (getreal "\nDeck block offset: "))
 (initget 1)
 (setq X (getreal "\nEnter deck block X: "))
 (initget 7)
 (setq L (getreal "\nVang rope length: "))
 (setq p0 '(0.0 0.0 12.0)
           p1 (list X offset 0.0)
           p2 (mapcar '* '(1 -1 1) p1)
           L1 18.0
           H 12.0
           mrad 0.75 ;; mast radius
           results nil
           ok 0
       alpha 0.0
       delalpha (@dtor 5.0)
       tol 0.0001
       oldL L
 )
(setq bang° (getreal "\nEnter Beta angle: "))
(setq bang (@dtor bang°))  
(setq cont T i 0)
 
(while cont
  (setq i (+ 1 i))
	;  guess for p3
  (setq	p3 (mapcar '+
		   p0
		   (list
		     (* (cos alpha) (cos bang) L1)
		     (* (cos alpha) (sin bang) L1)
		     (* (sin alpha) L1)
		   )
	   )
  )
;;; (command "_point" p3 "")  ; uncomment to see convergence

	; determine current vang length cL
  (setq cL (+ (distance p1 p3) (distance p3 p2)))
	; calculate error
  (setq er (- oldL cL))
  (if (< (abs er) tol)
    (setq cont nil)
    (progn
      (if (> L cL)
	(setq alpha (+ alpha delalpha))
	(setq alpha (- alpha delalpha))
      )					;end if
      (setq delalpha (/ delalpha 2.0))
      (setq oldL cL)
      (if (> i 25)			; quit if no convergence after n iterations
	(setq cont nil)
      )
    )					;end if false
  )					; end if
)					; end while

(command "_point" p3 "")
  (princ "\ncL = ") (princ cL)
  (princ "\np3 = ") (princ p3)
  

;;; old code  
;;;(foreach bang° '(0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 89.9)
;;;  (setq	bang (@dtor bang°)
;;;	p3   (polar p0 bang L1)
;;;  )
;;;  (if (<= bang (angle p2 p0))
;;;    (setq ang (angle p3 (@midp p1 p2))
;;;	  p4  (polar p3 ang 100)
;;;	  ok  1
;;;    )
;;;    (setq ang (angle p3 (@midp p1 p0))
;;;	  p4  (polar p3 ang 100)
;;;	  ok  1.5
;;;    )
;;;  )
;;;  (if (> bang (angle p2 p0))
;;;    (setq angb (angle p0 p3)
;;;	  angc (angle p2 p0)
;;;	  p    (polar p0 (* 0.5 (+ angb angc)) mrad)
;;;    )
;;;    (setq p p2)
;;;  )
;;;  (setq ok 5)
;;;  (if (> bang (angle p2 p0))
;;;    (setq ang (* 0.5 (+ (angle p3 p1) (angle p3 p)))
;;;	  p4  (polar p3 ang 100.0)
;;;    )
;;;    (setq ang (* 0.5 (+ (angle p3 p1) (angle p3 p2)))
;;;	  p4  (polar p3 ang 100.0)
;;;    )
;;;  )
;;;  (setq	Z  H
;;;	p3 (@3d p3 H)
;;;	A! (distance p1 p3)
;;;	B! (distance p p3)
;;;	C! 0.0
;;;  )
;;;  (setq ok 6)
;;;  (while (not (equal (+ A! B! C!) L 0.001))
;;;    (if	(> bang (angle p2 p0))
;;;      (setq C  (distance p2 (@2d p))
;;;	    B  (distance (@2d p) (@2d p3))
;;;	    p5 (@3d p (* Z (/ C (+ C B))))
;;;	    C! (distance p2 p5)
;;;	    B! (distance p5 p3)
;;;      )
;;;    )
;;;    (setq alpha	(@asin (/ (- Z H) L1))
;;;	  ok	6.1
;;;	  fract	(/ L (+ A! B! C!))
;;;	  ok	6.2
;;;	  Z	(* Z fract)
;;;	  ok	6.3
;;;	  p3	(@3d p3 Z)
;;;	  L1	(distance (@2d p0) (@2d p3))
;;;	  ok	6.4
;;;    )
;;;    (if	(> bang (angle p2 p0))
;;;      (setq p5 (@3d p (* Z (/ C (+ C B))))
;;;	    C! (distance p2 p5)
;;;	    B! (distance p5 p3)
;;;	    A! (distance p1 p3)
;;;      )
;;;      (setq A! (distance p1 p3)
;;;	    B! (distance p2 p3)
;;;	    C! 0.0
;;;      )
;;;    )
;;;    ;;      (if (< ok 7) (print (list (angtos bang 1 0)(angtos (- ang pi) 0 3) (+ A! B! C!) fract Z)))
;;;    (setq ok 7)
;;;  )
;;;  (setq	results	(cons (list (angtos bang 1 0)
;;;			    (angtos (- ang pi) 1 0)
;;;			    (+ A! B! C!)
;;;			    Z
;;;			    (angtos alpha 1 0)
;;;		      )
;;;		      results
;;;		)
;;;	ok	8
;;;  )
;;;); end foreach

  
;;;  (princ (strcat "\nDeck block offset: " (rtos offset 4 2)))
;;;  (princ (strcat "\nVang length: " (rtos L 4 2)))
;;;  (mapcar 'print (reverse results))
;;;  (princ (strcat "\nVertical range: " (rtos (- (apply 'max (mapcar '(lambda (x)(nth 3 x)) results)) (apply 'min (mapcar '(lambda (x)(nth 3 x)) results)) ) 4 3)))
;;;  (setq ok 10)
  (princ)
)

 

Note, I have not tested this much and may need to re-evaluate the initial guess for p3.

  

lee.minardi
0 Likes
Message 56 of 59

john.uhden
Mentor
Mentor

Why, thank you very kindly, Lee.

I think I approve of your methodology.

Yes, I have noticed that my position of P3 always uses a horizontal not 3D distance of L1 from P0.

For 30° our Z value was different by only 0.1" which to me is negligible.

Now if you can add the wrap-around, I would have a very accurate function.

Looks like I'll be racing again this evening... no vang or hiking strap, but the wind is forcasted to be only 7-8 mph.

I think I should probably wear my PFD anyway.

John F. Uhden

0 Likes
Message 57 of 59

leeminardi
Mentor
Mentor

John,

 

Glad you made it out to sail.  We've finally had some great weather.  My hang gliding is on hold but did manage to mountain bike yesterday on a mountain with a 1000 foot climb yesterday.  When I got back I put some time into the vang rope challenge.

 

I've made very good progress and now have a routine that will calculate the length of rope if it wraps around the mast. The next step is to incorporate the code with the case when the mast does not interfere.

 

Please check out the following code. I've "hard wired" the location of the cleats and other parameters in the function test.  It makes it easier to debug.  The code draws the straight sections of rope but not the elliptical portion that wraps around the mast.  The calculated rope length DOES include the section of rope in contact with the mast.  

 

It's been a fun project. Does it make sense for me to take this further?   If so what would you like to see?  I can make a drawing that shows the meaning of some of the variables I used if that would be helpful.  

image.png

 

(defun c:test (/)
; determines the route of the vang rope from p1 to p3 then wraps arund the mast to get to p2
; L. Minardi 8/27/2020 version 3   DRAFT  
  (command "osmode" 0)
  (setq	p0   '(0 0 12)  ; point on mast centerline
	p1   '(-10 12 0) ; vang cleat on deck
	p2   '(-10 -12 0); vang cleat on deck
	r    2.0         ; mast radius
	side 2           ; desigantes which tangent point to use, CCW from centerline = 1
	p3   '(5. 20.0 15.0)  ; block on boom
  )
; calculate line from deck cleat to mast
  (setq ptang1 (CylTangent p0 p1 p2 p3 p2 r side))
  (command "_line" p2 ptang1 "")
  (command "_point" ptang1)
; calculate line from boom (p3) to mast
  (setq side 1)
  (setq ptang2 (CylTangent p0 p1 p2 p3 p3 r side))
  (command "_line" p3 ptang2 "")
  (command "_point" ptang2)
  (command "_point" ptang2)
  (vanglen r p0 p1 p2 p3 ptang1 ptang2)
  (command "_line" p1 p3 "")
  (princ "Total rope length for rope wrapping mast: ")
  (princ totL)
  (princ)
)
(defun vangLen (r p0 p1 p2 p3 t1 t2)
; outouts total length of rope when it wraps around the mast
; t1 and t2 are the two tangent points  
  (setq ang1 (angle p0 t1)
      ang2 (angle p0 t2)
      delang (abs (- ang1 ang2)))
 (setq totL (+
	      (distance p1 p3)
	      (distance p3 t2)
	      (distance t1 p2)
	      (* r delang (abs (- (caddr t1) (caddr t2))))))
  (princ)
)  

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun CylTangent (p0 p1 p2 p3 p4 r side /)
; calculates a line from a point p4 tangent to a cylinder. The line lies
; on a plane defined by p1 p2 p3.  The cylinder has a radius r and is perpendicular
; to the xy plane with a point p0 on the cylinder's centerline.
; Side defines which of the two posible solutions will be output.
; Side = 2 will provide the non-default solution.
;  
  (setq	s (mapcar '-
		  (list (car p0) (cadr p0) 0.0)
		  (list (car p4) (cadr p4) 0.0)
	  )
  )
  (setq smag (distance '(0 0 0) (list (car s) (cadr s) 0.0)))
  (setq thetr (asin (/ r smag)))
  (if (= side 2)
    (setq thetr (* -1.0 thetr))
  )
  (setq	p4pe (list
	       (- (* (car s) (cos thetr))
		  (* (cadr s) (sin thetr))
	       )
	       (+ (* (car s) (sin thetr))
		  (* (cadr s) (cos thetr))
	       )
	       0.0
	     )
  )
  (setq d (distance '(0 0 0) (list (car p4pe) (cadr p4pe) 0.0)))
  (setq up4pe (mapcar '/ p4pe (list d d d)))
  (setq d (* smag (cos thetr)))
  (setq pe (mapcar '+ p4 (mapcar '* up4pe (list d d d))))
  (setq uSlope (Slope p1 p2 p3))
  (setq pez (* (/ (caddr uslope) (car uslope)) (- (car pe) (car p2))))
  (setq petang (list (car pe) (cadr pe) pez))
;;;  (command "_line" p4 petang "")
;;;  (command "_point" petang )

)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun Slope (  pA pB pC / )
;outputs a unit vector of the slope of a plane given:
; ptA, ptB - two points on the edge of the plane on the z = 0 plane
; ptC = a point on the plane not collinear with ptA and ptB  
(setq uAB (uVector (mapcar '- pB pA)))
(setq uNormal (uVector (cross (mapcar '- pA pC) (mapcar '- pB pC))))
(setq uSlope  (uVector (cross uNormal uAB)))
  )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun uVector (v / )
; outputs the unit vector of v
(setq v   (mapcar '/ v (list (distance '(0 0 0) v) (distance '(0 0 0) v) (distance '(0 0 0) v))))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; outputs the arcsine of x
(defun asin (x)
  (if (<= -1.0 x 1.0)
    (atan x (sqrt (- 1.0 (* x x))))
  )
  
)
;;; Compute the dot product of 2 vectors a and b
(defun dot (a b / dd)
  (setq dd (mapcar '* a b))
  (setq dd (+ (nth 0 dd) (nth 1 dd) (nth 2 dd)))
)					;end of dot
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Compute the cross product of 2 vectors a and b
(defun cross (a b / crs)
  (setq	crs (list
	      (- (* (nth 1 a) (nth 2 b))
		 (* (nth 1 b) (nth 2 a))
	      )
	      (- (* (nth 0 b) (nth 2 a))
		 (* (nth 0 a) (nth 2 b))
	      )
	      (- (* (nth 0 a) (nth 1 b))
		 (* (nth 0 b) (nth 1 a))
	      )
	    )				;end list
  )					;end setq c
)					;end cross
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  

lee.minardi
0 Likes
Message 58 of 59

john.uhden
Mentor
Mentor
@leeminardi:

That's truly wonderful, and will be a great education for me once I figure
it out,
BUT, the object was to compute the Z of p3 given a specified length of the
vang on its route from p1 to p3 to p2 for various boom angles.
Right now I have something close, not at all as brilliant as your methods,
but it seems to work fairly well.
Then again, I'm not happy with the way my invention is performing. My mind
is now wandering to using one or two deck tracks. Harken makes them
straight or curved both horizontally and vertically (min. radius = 42"),
but that's a lot of money to put into a cheap Sunfish.

John F. Uhden

0 Likes
Message 59 of 59

leeminardi
Mentor
Mentor

@john.uhden 

 

To determine the Z of p3 we need to calculate the position of p3. As you pointed out there are two major different configurations that determine the position of p3. Case #1 is that the mast does not interfere with the rope. For case # 2 the mast does interfere. The code in my post #55 will calculate the position of p3 if the mast does not interfere with the rope (case #1). The code in my post #57 determines the length of rope if the mast interferes with the rope. The length of rope is needed to solve for the location of p3.


The next step is to write code to determine if the mast interferes with the rope and then if it does use the numerical approach of post #55 along with some of the code in post #57 to determine the location of p3. After determining p3 we of course have the Z value you seek. The force in the vang rope can be determined from a free body diagram of the boom assuming a value for the moment that the wind on the sail generates on the boom.


Note, I may have used the wrong terminology in the code comments. P1 and P2 are the locations of the blocks on deck not the cleats. BTW, my hang glider has a cleat for a rope known as the VG (variable geometry). Pulling it tightens the sail improving glide but negatively impacting ease of handling. In general you tighten the sail to fly faster through air that is sinking while loosening the sail to gain handling for tight circling in a thermal and when landing.

lee.minardi
0 Likes