Author Topic: (Challenge) A Rose By Any Name  (Read 3667 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
(Challenge) A Rose By Any Name
« on: July 11, 2007, 01:16:15 AM »


Simple Challenge :
Give this Routine a Name
and write a description Header.
Code: [Select]
(DEFUN ARoseByAnyName (ang)
    (WHILE (MINUSP ang) (SETQ ang (+ ang PI)))
    (WHILE (> ang  PI) (SETQ ang (- ang  PI)))
    (IF (AND (> ang (* 0.5 PI)) (<= ang (* 1.5 PI)))
        (- ang PI)
        ang
    )
)


Helpers :
(DEFUN _rtd (ang) (/ (* ang 180.0) PI))
(DEFUN _dtr (ang) (* PI (/ ang 180.0)))


TestCode :
(_RTD (ARoseByAnyName (_DTR -700.4)))
(_RTD (ARoseByAnyName (_DTR 15)))
(_RTD (ARoseByAnyName (_DTR 90)))
(_RTD (ARoseByAnyName (_DTR 180)))
(_RTD (ARoseByAnyName (_DTR 270)))
(_RTD (ARoseByAnyName (_DTR 335)))
(_RTD (ARoseByAnyName (_DTR -20)))
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (Challenge) A Rose By Any Name
« Reply #1 on: July 11, 2007, 03:38:48 AM »
.. and no Maverick, "A Waste of Time" isn't a good name. :-)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Arizona

  • Guest
Re: (Challenge) A Rose By Any Name
« Reply #2 on: July 11, 2007, 06:11:06 AM »
Kerry,
Thanks, I couldn't help but smile over that :lmao:

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: (Challenge) A Rose By Any Name
« Reply #3 on: July 11, 2007, 08:34:50 AM »
_NormalizeAngle
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: (Challenge) A Rose By Any Name
« Reply #4 on: July 11, 2007, 08:37:41 AM »
(PS: doesn't need a header).
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (Challenge) A Rose By Any Name
« Reply #5 on: July 11, 2007, 08:41:12 AM »
Well ... I'll be a monkeys uncle !!

I had named it kdub:NormalizeAngle ....

but that didn't seem quite right to me.


great minds ... heh !

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

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: (Challenge) A Rose By Any Name
« Reply #6 on: July 11, 2007, 08:42:04 AM »
<ding> <ding>
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Maverick®

  • Seagull
  • Posts: 14778
Re: (Challenge) A Rose By Any Name
« Reply #7 on: July 11, 2007, 09:18:18 AM »
.. and no Maverick, "A Waste of Time" isn't a good name. :-)

I'm trying to learn from experience and not comment on anything with code Kerry.  :-D

Well ... I'll be a monkeys uncle !!

  What are the chances of that?  You and my father must have been separated at birth.  :-D

Chuck Gabriel

  • Guest
Re: (Challenge) A Rose By Any Name
« Reply #8 on: July 11, 2007, 12:21:18 PM »
Well ... I'll be a monkeys uncle !!

I had named it kdub:NormalizeAngle ....

but that didn't seem quite right to me.


great minds ... heh !

 

I actually typed the name NormalizeAngle into the Quick Reply box this morning, but then didn't post it, because I thought you would think it was a silly name. :-)

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8858
  • AKA Daniel
Re: (Challenge) A Rose By Any Name
« Reply #9 on: July 11, 2007, 12:35:29 PM »
So your all related?

Chuck Gabriel

  • Guest
Re: (Challenge) A Rose By Any Name
« Reply #10 on: July 11, 2007, 12:44:30 PM »
So your all related?

Nope it's a subconscious psychic link.  We're unwitting participants in a hive mind. :D

LE

  • Guest
Re: (Challenge) A Rose By Any Name
« Reply #11 on: July 11, 2007, 12:59:28 PM »
So your all related?

Nope it's a subconscious psychic link.  We're unwitting participants in a hive mind. :D

Or the "Three Amigos"

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: (Challenge) A Rose By Any Name
« Reply #12 on: July 11, 2007, 01:16:44 PM »
Or the "Three Amigos"

More like --



:-D
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst