Mathematica Asked by Inzo Babaria on February 7, 2021
I have three vectors:
v1={1,0,0} v1={0,1,0} v1=1/2{1,1,1}
I wish to show the volume constructed by these vectors.
I know the amount of this volume is calculated by
1/2 Dot[Cross[{1, 0, 0}, {0, 1, 0}], {1, 1, 1}]
But I do not know how to draw this volume!!!
Use Parallelepiped
:
v1 = {1, 0, 0};
v2 = {0, 1, 0};
v3 = 1/2 {1, 1, 1};
Graphics3D[Parallelepiped[{0, 0, 0}, {v1, v2, v3}]]
Answered by yawnoc on February 7, 2021
To include the vectors in the drawing:
v = {{1, 0, 0}, {0, 1, 0}, 1/2 {1, 1, 1}};
ℛ = Parallelepiped[{0, 0, 0}, v];
Graphics3D[{
{Opacity[0.7], ℛ},
{Red, Arrowheads[0.05],
Arrow[Tube[{{0, 0, 0}, #}, 0.01]] & /@ v}},
Axes -> True,
BoxRatios -> {1, 1, 1}]
The volume can be calculated multiple ways
{Volume[ℛ], RegionMeasure[ℛ], Integrate[1, {x, y, z} ∈ ℛ]}
(* {1/2, 1/2, 1/2} *)
SameQ @@ %
(* True *)
Answered by Bob Hanlon on February 7, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP