title
English page Russian page
13:55:41  ¤ 

ISCLOCKWISE.PAS

unit IsClockWise;

interface

implementation

/// Aeai?eoi ii?aaaeaiey iai?aaeaiey ia?a?eneaiey aa?oei iieeaiia ( e ni?aeaie? ia oi?iue)
Function IsClockWise(P:TPolygon):Boolean;
Var i  : Integer;
    e  : T2DEdge;
    et : TPos;
    pt : T2DPoint;
Begin
  Result := True;
  et :=BETWEEN;
  // iaeoe oi?eo neaaa eee ni?aaa io ?aa?a
  For i:=0 To P.size-1 Do Begin
    e := p._Edge;
    If (E.org.Y<>E.dest.Y) Then Begin //
      pt.x := (E.org.X+E.dest.x)/2+0.1;// na?aaeia io?acea e aua 0.1<-(caanu eae ?ac ia oi?iinou)
      pt.y := (E.org.y+E.dest.Y)/2;
      et := __classifyE(pt,E);
      Break;
    End;
    P.advance(CLOCKWISE);
  End;

  If _pointInPolygon(pt,P)=INSIDE Then Begin
    Case et of
      RIGHT:Result := True;// anee oi?ea aioo?e iieeaiia e ni?aaa, oi cae?ooea ii ?aniaie no?aeea CLOCKWISE
      LEFT :Result := False; // anee oi?ea aioo?e iieeaiia e neaaa, oi cae?ooea i?ioea ?aniaie no?aeee COUNTER_CLOCKWISE
    End;//Case
  End Else Begin
    Case et of
      LEFT :Result := True; // anee oi?ea nia?o?e iieeaiia e neaaa, oi cae?ooea ii ?aniaie no?aeee CLOCKWISE
      RIGHT:Result := False;// anee oi?ea nia?o?e iieeaiia e ni?aaa, oi cae?ooea i?ioea ?aniaie no?aeee COUNTER_CLOCKWISE
    End;//Case
  End;
End;

end.

Generated by PasToWeb, a tool by Marco Cantù.





THE COPYRIGHT of THIS DOCUMENT IS THE PROPERTY OF Victor Nekrasov.
All rights reserved. No part of this documentation may be reproduced by any means в any material form
(including photocopying or storing it в any electronic form) without the consent of the Copyright Owner or under the terms of a licence and/or confidentiality agreement issued by the Copyright Owner, Victor Nekrasov. Applications for the copyright owners permission to reproduce any part of this documentation should be addressed to, Victor Nekrasov, vinek@list.ru

© 1998-2023 Victor Nekrasov