raycasting – How to find if a Ray intersects a Triangle Clockwise or Counter Clockwise

Assume the triangle’s vertices are wound in the order A, B, C

Form a normal to the triangle N = (B – A) x (C – A)

Now you can detect whether your triangle is clockwise or counter-clockwise by the sign of the dot product between this normal and the ray direction

In a left-handed coordinate system:

  • Negative = Clockwise from ray’s point of view
  • Positive = Counter-clockwise from ray’s point of view

In a right-handed coordinate system, it’s the opposite:

  • Negative = Counter-clockwise from ray’s point of view
  • Positive = Clockwise from ray’s point of view

Generate Aztec triangle of size n automatically?

In the paper titled "Perfect Matchings of Cellular Graphs" by Mihai Ciucu, the Aztec triangle of size n (n= 1, 2, 3, 4, 5, ...) is equivalent to a triangular grid of n1 squares (n1 = 1, 4, 9, 16, 25, ...) .

See the following example:

Is there a automatical way to generate such patterns?

Also are there some general method to generate Aztec diamond of order n (not just triangle)?

Thank you very much!

algorithms – Time complexity of the triangle factoring problem

The triangle factor problem is NP-complete in general (1) (and even for graphs of clique number 3), but solvable in polynomial time for some restricted graph classes like chordal graphs (2,3). These references will get you up to speed easily.

(1) Garey, Michael R., and David S. Johnson. “Computers and Intractability: A Guide to the Theory of NP-completeness” (1979).

(2) Guruswami, Venkatesan, C. Pandu Rangan, Maw-Shang Chang, Gerard J. Chang, and Chak-Kuen Wong. “The vertex-disjoint triangles problem.” In International Workshop on Graph-Theoretic Concepts in Computer Science, pp. 26-37. Springer, Berlin, Heidelberg, 1998.

(3) Dahlhaus, Elias, and Marek Karpinski. “Matching and multidimensional matching in chordal and strongly chordal graphs.” Discrete Applied Mathematics 84, no. 1-3 (1998): 79-91.

mathematics – Ray-Triangle Intersection: does the direction of the triangle normal matter?

Remember that A, B, and C come from the normal too. So negating the normal flips the sign of all four terms, making:

-A x – B y – C z – D &= 0\
(-1)(Ax + By + Cz + D) &= 0\
(-1) times (-1)(Ax + By + Cz + D) &= (-1) times 0\
Ax + By + Cz + D &= 0

So you can see, negating the normal still gives us an equivalent equation, with all the same solutions as the original.

The direction of the normal can matter for lighting, but it does not alter the equation of the plane.

The resource you’re using contains an error, though. if $ vec n = (A, B, C)$ is the plane normal, then $D = – vec n cdot vec p$ for a point $vec p$ in the plane. The article you linked neglects that minus sign.

Another way of thinking of this: if your normal is a unit vector, then $D$ is a signed distance from the plane to the origin, along the direction of the normal. If the normal points toward the origin, this signed distance is measured in the same direction as the normal, and gives a positive value. If the normal points away from the origin, then this distance is measured in the direction opposite the normal, and gives a negative value.

Meanwhile, $Ax + By + Cz$ measures a signed distance from the origin to the plane perpendicular to $(A, B, C)$ containing the point $(x, y, z)$.

Since the “from” and “to” are flipped between these two parts, the two values will have the same magnitude but opposite sign for any $(x, y, z)$ on the plane, cancelling out to the zero on the right hand side.

(If the normal is not a unit vector, the same argument applies, except now we’re dealing with a scaled distance – like we measured it with a different choice of units)

mg.metric geometry – Equal products of triangle areas

Claim. Given hexagon circumscribed about an ellipse. Let $A_1,A_2,A_3,A_4,A_5,A_6$ be the vertices of the hexagon and let $B$ be the intersection point of its principal diagonals. Denote area of triangle $triangle A_1A_2B$ by $K_1$, area of triangle $triangle A_2A_3B$ by $K_2$,area of triangle $triangle A_3A_4B$ by $K_3$,area of triangle $triangle A_4A_5B$ by $K_4$,area of triangle $triangle A_5A_6B$ by $K_5$ and area of triangle $triangle A_1A_6B$ by $K_6$ .Then, $$K_1 cdot K_3 cdot K_5=K_2 cdot K_4 cdot K_6$$

Describe a Monte Carlo algorithm for the Triangle Packing problem

Although I agree with Yuval, I’ll try to get you started on the connection to their longest path approach. The goal is, given a graph $G$, to define a polynomial $P_G$ which is nonzero iff $G$ has $k$ disjoint triangles. If you could evaluate $P_G$ on an arbitrary point in the underlying field $mathbb{F}$ in time $2^{3k}n^{O(1)}$ then Schwartz-Zippel gives you the desired result (assuming that the degree of $P_G$ is low enough compared to $|mathbb{F}|)$.

Denote by $T$ the set of all length $3k$ vertex sequences $(v_1,…,v_{3k})$ such that for all $i$ satisfying $i=1pmod 3$, the triplet $(v_i,v_{i+1},v_{i+2})$ is a triangle in $G$. Now, it is not hard to see that if $mathbb{F}$ has characteristic 2 then the following polynomial (over $|E|+3k|V|$ variables) is nonzero (i.e. has a nonzero coefficient) iff $G$ contains $k$ disjoint triangles:

$P_G(pmb{x_e},pmb{y_{(v,j)}})=sumlimits_{(v_1,…,v_{3k})in T}sumlimits_{lin S_{(3k)}}prodlimits_{iin(3k)}x_{(v_i,v_{i+1})}prodlimits_{iin(3k)} y_{i,l(i)}$

Where $S_n$ is the symmetric group. The hard part is evaluating $P_G$ without going over all possible sequences in $T$. The fact that we don’t care about repetitions in sequences in $T$ will allow (after some considerable work in rewriting $P_G$) efficient dynamic programming to come into play. The rest pretty much follows the proof for the longest path case (after extending the sum to functions whose range is a subset of $(3k)$, the dynamic programming part would look a bit different, e.g. you would probably want to shorten the sequence by three elements at a time).

mg.metric geometry – A generic question on triples of circles associated with a triangle

This question is inspired by two posed by P.Terzić (both given elegant synthetic proofs by F. Petrov). The starting point is a triangle $ABC$ and a triangle centre $G_1$. There are two classical ways to use this to generate a new triangle $A_1B_1C_1$ where the new vertices are

  1. the reflections of the original ones in $G_1$;


  1. the feet of the Cevians through this point.

We now add a second centre $G_2$ to the ingredients and consider the three circles through $AG_2 A_1$, $BG_2B_1$ and $CG_2C_1$.

These three circles have the one common point $G_2$, of course, and our question is to determine under which conditions they have a second one. More specifically, our question is whether the following dichotomy holds:

For a given (distinct) pair of triangle centres, then either the above result holds or the triangle is isosceles.

Remarks. 1. The results of Petrov display two situations where the first situation is true.

  1. we are using the term “circle” in the generalised sense which includes lines. These occur in the specal case of an isosceles triangle (for an equilateral one we have three lines through the centre–the second point of intersection is at infinity).

  2. we refer to the online Encyclopedia of Triangle Centers for the concepts and notations we are using.

  3. since there are now over $40,000$ registered centres there are potentially that number squared such results. Hence a synthetic proof can’t be expected and one is forced to apply Tate’s maxim–think geometrically, prove algebraically.

unity – How can I calculate the inertia tensor of a hollow object defined by a triangle mesh?

unity – How can I calculate the inertia tensor of a hollow object defined by a triangle mesh? – Game Development Stack Exchange

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheapest USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Proxyti.com Buy Quality Private Proxies