Author Topic: How to make the tangent?  (Read 1190 times)

0 Members and 1 Guest are viewing this topic.

2e4lite

  • Guest
How to make the tangent?
« on: November 01, 2013, 10:27:16 PM »
    Who can write a program that can make the tangent by specifying the point in 2d curves,the length and the angle?  It will a great help to me.Thanks!
« Last Edit: November 01, 2013, 11:18:44 PM by 2e4lite »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to make the tangent ?
« Reply #1 on: November 01, 2013, 10:37:33 PM »
Please clarify your question.

What information do you know.?




Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

ymg

  • Swamp Rat
  • Posts: 725
Re: How to make the tangent?
« Reply #2 on: November 02, 2013, 04:14:26 AM »
Not sure if it is what you are looking for, but using this little bit of code by AlanJT
you have the angle.  You already have the point.

So your tangent is an xline starting at your point with angle as slope.

ymg

Code - Auto/Visual Lisp: [Select]
  1. ;; Return angle along curve, at specified point (on curve)                    ;
  2. ;; e - valid curve (ENAME or VLA-OBJECT)                                      ;
  3. ;; p - point on curve                                                         ;
  4. ;; Alan J. Thompson, 11.04.10                                                 ;
  5.  
  6. (defun AngleAtPoint (e p)
  7. )
  8.  
  9. ;; Example call and entmaking an XLINE
  10. (setq a (angleatpoint enameofcurve point))
  11. (entmakex   (list    '(0 . "XLINE")  '(100 . "AcDbEntity")  '(100 . "AcDbXline")  '(62 . 1) (cons 10 point)  (list 11 (cos a) (sin a) 0.0)))
  12.  
« Last Edit: November 02, 2013, 04:46:56 AM by ymg »