Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
3 points are clockwise or counter-clockwise?
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: 3 points are clockwise or counter-clockwise? (Read 2579 times)
0 Members and 1 Guest are viewing this topic.
FELIX
Bull Frog
Posts: 242
3 points are clockwise or counter-clockwise?
«
on:
March 23, 2014, 09:43:13 PM »
3 data points PT1, PT2 and PT3 are determining whether clockwise or counterclockwise?
Logged
OK.
Kerry
Mesozoic relic
Seagull
Posts: 11654
class keyThumper<T>:ILazy<T>
Re: 3 points are clockwise or counter-clockwise?
«
Reply #1 on:
March 23, 2014, 10:04:10 PM »
Have a play with this (from a site search) :-
http://www.theswamp.org/index.php?topic=13526.msg234360#msg234360
From gile
Code - Auto/Visual Lisp:
[Select]
;;; Clockwise-p Evaluates if p1 p2 et p3 are clockwise
;; gile http://www.theswamp.org/index.php?topic=13526.msg234360#msg234360
(
defun
clockwise
-
p
(
p1 p2 p3
)
(
<
(
sin
(
-
(
angle
p1 p3
)
(
angle
p1 p2
)
)
)
-
1e
-
14
)
)
Logged
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.
FELIX
Bull Frog
Posts: 242
Re: 3 points are clockwise or counter-clockwise?
«
Reply #2 on:
March 23, 2014, 11:05:24 PM »
Very good, thank you so much!
Logged
OK.
gile
Gator
Posts: 2520
Marseille, France
WWW
Re: 3 points are clockwise or counter-clockwise?
«
Reply #3 on:
March 24, 2014, 02:29:43 AM »
Hi,
Another way using the double signed area of the triangle:
Code - Auto/Visual Lisp:
[Select]
(
defun
clockwise
-
p
(
p1 p2 p3
)
(
minusp
(
-
(
*
(
-
(
car
p2
)
(
car
p1
)
)
(
-
(
cadr
p3
)
(
cadr
p1
)
)
)
(
*
(
-
(
car
p3
)
(
car
p1
)
)
(
-
(
cadr
p2
)
(
cadr
p1
)
)
)
)
)
)
Logged
Speaking English as a French Frog
Lee Mac
Seagull
Posts: 12922
London, England
WWW
Re: 3 points are clockwise or counter-clockwise?
«
Reply #4 on:
March 24, 2014, 07:17:57 PM »
Another few:
http://lee-mac.com/clockwisep.html
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
3 points are clockwise or counter-clockwise?