Author Topic: Question of the day #5  (Read 6119 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Question of the day #5
« on: December 01, 2004, 07:48:43 AM »
What does the following function calculate?
 
Code: [Select]

(defun func (a b c)
  (defun sq (n) (* n n))
  (/
    (-
      (+ (sq b) (sq c))
      (sq a)
      )
    (* 2 b c)
    )
  )

(func 85.0 100.0 80.0)
0.573438
TheSwamp.org  (serving the CAD community since 2003)

whdjr

  • Guest
Question of the day #5
« Reply #1 on: December 01, 2004, 09:44:30 AM »
You know we need to set up rules or guidlines for these questions.
Something kinda like:

1.  Please don't post your answer until 3 hours after the initial post.
     (So that everyone's answer is completely bias.  Also if I see someone
      else has already answered it I might not even try.)

2.  During this time frame someone could ask questions or you could
     give out hints or clues.

3.  People could also chime in with "I got my answer.  How about you guys?".


These are just a few thoughts to make this fun and good learning at the same
time.  If the answer is posted within 2 minutes of the original post newbies might get discouraged.

Just my thoughts so please don't beat them up too bad.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Question of the day #5
« Reply #2 on: December 01, 2004, 09:47:39 AM »
good idea
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.

whdjr

  • Guest
Question of the day #5
« Reply #3 on: December 01, 2004, 10:33:09 AM »
You edited your post Kerry :D

Man, I'm stumped!?!?!?!?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Question of the day #5
« Reply #4 on: December 01, 2004, 10:47:55 AM »
I agree, some guidelines would be a good. The problem is the time frame. If we make 3 hours then some one is going to get left out, and 24 hours may be to long. But I agree we to do something.

How does this sound?

Question of the day guidelines:
1. Please do not post your answer for 24 hours after the time of the post.
2. If you wish you may post something like "I've got it!"
3. Feel free to ask questions, or for hints.
4. Feel free to PM the person who asked the question.
5. Do not be embarrassed by your answer or code.
TheSwamp.org  (serving the CAD community since 2003)

CADaver

  • Guest
Re: Question of the day #5
« Reply #5 on: December 01, 2004, 10:52:03 AM »
Quote from: Mark Thomas
Code: [Select]

(defun func (a b c)
  (defun sq (n) (* n n))
  (/
    (-
      (+ (sq b) (sq c))
      (sq a)
      )
    (* 2 b c)
    )
  )

(func 85.0 100.0 80.0)
0.573438


Lesee, you're adding the squares of b and c, then subtracting the square of a.  Then you're dividing the whole mess by 2 times b times c.

Dunno man, looks sorta familiar, but I ain't gotta clue.

whdjr

  • Guest
Question of the day #5
« Reply #6 on: December 01, 2004, 10:52:36 AM »
Mark,

Those sound very good.  3 hours was just a time I used for illustration.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Question of the day #5
« Reply #7 on: December 01, 2004, 12:14:48 PM »
Well, like CADaver, it looks soooo familiar, but I just can't place it ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

dubb

  • Swamp Rat
  • Posts: 1105
Question of the day #5
« Reply #8 on: December 01, 2004, 12:19:55 PM »
no multiple choice?

JohnK

  • Administrator
  • Seagull
  • Posts: 10661
Question of the day #5
« Reply #9 on: December 01, 2004, 12:54:24 PM »
I think encrypted answers would be cool (that way the first person to have the correct answer "wins".). ...Once the time is up we just post our keys to decrypt the answers.

So that means no edited posts. (if they do edit the post we assume cheeting.)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

whdjr

  • Guest
Question of the day #5
« Reply #10 on: December 01, 2004, 01:00:05 PM »
Sounds great Se7en.

So whose got the encryption tool?  I know I had mine around here somewhere....?

CarlB

  • Guest
Question of the day #5
« Reply #11 on: December 01, 2004, 01:00:16 PM »
OK I found it but to not spoil all the fun I'll just drop a hint.  Has to do with a triangle.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Question of the day #5
« Reply #12 on: December 01, 2004, 01:05:09 PM »
Quote from: CarlB
OK I found it but to not spoil all the fun I'll just drop a hint.  Has to do with a triangle.

I was going to say dinner bell, but thought better of it. :D
TheSwamp.org  (serving the CAD community since 2003)

JohnK

  • Administrator
  • Seagull
  • Posts: 10661
Question of the day #5
« Reply #13 on: December 01, 2004, 01:07:53 PM »
Quote from: whdjr
Sounds great Se7en.

So whose got the encryption tool?  I know I had mine around here somewhere....?

We can make our own.  (I cant do it now cause all my stuff i at home. But i can see how far i can get.) But im sure some ones got some code that can be modified real quick.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

dubb

  • Swamp Rat
  • Posts: 1105
Question of the day #5
« Reply #14 on: December 01, 2004, 02:38:52 PM »
A WILD GUESS......pythagorean theorem? in code?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Question of the day #5
« Reply #15 on: December 01, 2004, 02:57:29 PM »
Quote from: dubb
A WILD GUESS......pythagorean theorem? in code?

Nope!  that would be (+ (sq a)(sq b)) = (sq c) using our (sq) function from above.
TheSwamp.org  (serving the CAD community since 2003)

paulmcz

  • Bull Frog
  • Posts: 202
Question of the day #5
« Reply #16 on: December 01, 2004, 03:24:03 PM »
cosine of an angle opposite to side 'a', in triangle a-b-c where a=85, b=100, c=80

CADaver

  • Guest
Question of the day #5
« Reply #17 on: December 01, 2004, 06:03:44 PM »
Man I haven't run a cosine since Fortran IV, no wonder I missed it.   :shock:

What's next Sanscrit?  :wink:

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Question of the day #5
« Reply #18 on: December 01, 2004, 11:43:56 PM »
Dangit .... and I was thinking that was what it is....I have not studied trig in so long, I think I have nearly forgot everything that I learned.....
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Question of the day #5
« Reply #19 on: December 03, 2004, 09:56:11 AM »
The law of cosines was the answer I was looking for.

Link:
http://faculty.stcc.edu/mcdonald/mm232/Cosines/cosines.htm
TheSwamp.org  (serving the CAD community since 2003)

whdjr

  • Guest
Question of the day #5
« Reply #20 on: December 03, 2004, 11:01:06 AM »
Awesome link Mark.  I checked out some of the other links there and they have some good stuff.

David Bethel

  • Swamp Rat
  • Posts: 656
Question of the day #5
« Reply #21 on: December 03, 2004, 12:01:36 PM »
I use the law of cosines this to determine the points for side-side-side triangle computation.

There would be good challange for you

Determine the points of a triangle based on

1) 1 point is always 0,0,0

2)  the various metheods of drawing constuction
side-angle-side
angle-side-angle
side-side-angle
side-side-side
 
-David
R12 Dos - A2K