New answers tagged

2

You can simply replace the function q using ReplaceAll (/.), e.g. Simplify[L /. q -> Function[{t}, Q[t]/Sin[A t]]] (* 1/2 m (A^2 Q[t]^2 + Q'[t]^2) *)


0

Suppose you have a vector p expressed as p = p1 e1 + p2 e2 + p3 e3 where e1, e2, e3 are a dextral triad of unit vectors and p1, p2 and p3 are scalars. Let n1, n2, n3 be another dextral triad of unit vectors. Then p = p1 (e1.n1 n1 + e1.n2 n2 + e1.n3 n3) + p2 (e2.n1 n1 + e2.n2 n2 + e2.n3 n3) + p3 (e3.n1 n1 + e3.n2 n2 + e3.n3 n3) You can collect terms to put ...


2

ClearAll[x]; n = 2; Tuples@Array[x, {n, 2}] {{x[1, 1], x[2, 1]}, {x[1, 1], x[2, 2]}, {x[1, 2], x[2, 1]}, {x[1, 2], x[2, 2]}} 3D: ClearAll[x]; n = 3; Tuples@Array[x, {n, 2}] {{x[1, 1], x[2, 1], x[3, 1]}, {x[1, 1], x[2, 1], x[3, 2]}, {x[1, 1], x[2, 2], x[3, 1]}, {x[1, 1], x[2, 2], x[3, 2]}, {x[1, 2], x[2, 1], x[3, 1]}, {x[1, 2], x[2, 1], x[3, 2]}, {x[1,...


4

An alternative, and to get them in clock wise order, is to use Outer product, something like canonicalizePolygon[{x1_, y1_}, {x2_, y2_}] := Module[{coord}, coord = Outer[List, {x1, x2}, {y1, y2}]; coord[[2]] = Reverse[coord[[2]]]; Flatten[coord, 1] ]; Call it as canonicalizePolygon[{x1, y1}, {x2, y2}] For a cubiod, same thing, find ...


3

Perhaps I didn't get the purpose of your question/application… The function CanonicalizePolygon helps to find the 4 points of Rectangle[{x1,y1},{x2,y2}] CanonicalizePolygon[Rectangle[ {x1, y1}, {x2, y2} ]][[ 1]] (*{{x1, y1}, {x1, y2}, {x2, y1}, {x2, y2}}*) or with assumptions CanonicalizePolygon[Rectangle[ {x1, y1}, {x2, y2} ],Assumptions -> {x2 &...


Top 50 recent answers are included