2
$\begingroup$
Clear["Global`*"];
SeedRandom[2];
p1 = RandomPolygon[{"Convex", 5}];
polypts = PolygonCoordinates@p1;
chmpts = (ConvexHullMesh[p1] // MeshPrimitives[#, 0] &) /. 
   Point :> Sequence;

g1 = MapThread[Text[#1, #2] &, {Range@Length@polypts, polypts}] // 
   Graphics;
g2 = MapThread[Text[#1, #2] &, {Range@Length@chmpts, chmpts}] // 
   Graphics;
Grid[{{Framed@g1, Spacer[10], Framed@g2}}]

enter image description here

The following inputs are returned unevaluated:

Through[{NegativelyOrientedPoints, PositivelyOrientedPoints}[polypts]]
Through[{NegativelyOrientedPoints, PositivelyOrientedPoints}[chmpts]]

Question

Aren't the chmpts (picture to the right above) oriented CCW i.e., positively oriented?

Thanks for your help.


Observation (Few moments later)

enter image description here

enter image description here

where d is the dimension.

$\endgroup$
3
  • $\begingroup$ If I correctly understand the documentation, in two dimensions NegativelyOrientedPoints/PositivelyOrientedPoints can be applied only to three points. For example, PositivelyOrientedPoints[chmpts[[1 ;; 3]]] produces True. $\endgroup$
    – user64494
    Dec 7, 2023 at 15:46
  • $\begingroup$ This is not as advertised. $\endgroup$
    – Syed
    Dec 7, 2023 at 15:50
  • 1
    $\begingroup$ Read Details: "In d dimensions, d+1 points p1,p2,…,pd+1 are negatively oriented if the determinant of the matrix {p2-p1,…,pd+1-p1} is negative". Of course, the documentation leaves much to be desired. $\endgroup$
    – user64494
    Dec 7, 2023 at 15:53

1 Answer 1

3
$\begingroup$

If I correctly understand the documentation, in two dimensions NegativelyOrientedPoints/PositivelyOrientedPoints can be applied only to three points. For example, PositivelyOrientedPoints[chmpts[[1 ;; 3]]] produces True. You can consequently consider PositivelyOrientedPoints[chmpts[[2 ;; 4]]] and so on.

$\endgroup$
4
  • $\begingroup$ Thanks. Partition[chmpts, 3, 1, 1] // Map[PositivelyOrientedPoints] returns {True, True, True, True, True} whereas Partition[polypts, 3, 1, 1] // Map[PositivelyOrientedPoints] does not. $\endgroup$
    – Syed
    Dec 7, 2023 at 16:02
  • $\begingroup$ @Syed: In fact, these are PositveOrientedVectors/NegativeOrientedVectors. $\endgroup$
    – user64494
    Dec 7, 2023 at 16:06
  • $\begingroup$ Is PositiveOrientedVectors a command in newer versions? I am running v12.2.0 on Win7-x64. $\endgroup$
    – Syed
    Dec 7, 2023 at 16:09
  • $\begingroup$ @Syed: No, there is not such a command in Mathematica at the present. $\endgroup$
    – user64494
    Dec 7, 2023 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.