# Get the displacement component which is perpendicular to the triangle (finite element)

1 view (last 30 days)
Miraboreasu on 26 Sep 2022
Commented: Chunru on 28 Sep 2022
Hey
I have a triangle in the space(x, y, z)
I know the displacements of three nodes in the vector form, namely
d1: 0.000131475 -0.000706995 0.000754736
d2: 6.02E-05 -0.000662299 0.000711364
d3: 0.000147876 -0.000661116 0.000729507
Is there any way to know the displacement of the trangle in the normal direction?
Do I need something called shape function and how to use it?
Miraboreasu on 27 Sep 2022
Torsten, can you please provide more details on displacement_in_normal_direction(P)
Torsten on 27 Sep 2022
Edited: Torsten on 27 Sep 2022
Chunru answered the displacement in normal direction for the extreme points of the triangle.
I think you should be able to transfer this to a general point within the triangle:
A general point within the (convex) triangle can always be represented as a convex combination of its extreme points:
P = lambda_1*A + lambda2 *B + lambda3*C
where A, B and C are the extreme points and
sum_i lambda_i = 1
My guess is that the displacement vector in P is
dP = lambda1*dA + lambda2*dB + lambda3*dC
and dot(dP,vnorm) should give the displacement of P in normal direction.

Benjamin Thompson on 26 Sep 2022
d1 = [0.000131475 -0.000706995 0.000754736]
You can make one of the vectors the origin by subtracting it from the other two, then use null to identify the orthogonal vector to those two.
d1 = [0.000131475 -0.000706995 0.000754736]
d2 = [ 6.02E-05 -0.000662299 0.000711364]
d3 = [0.000147876 -0.000661116 0.000729507]
A = [d3' - d1', d2' - d1', d1' - d1']
A =
1.0e-04 *
0.164010000000000 -0.712750000000000 0
0.458790000000000 0.446960000000000 0
-0.252290000000000 -0.433720000000000 0
» null(A)
ans =
0
0
1
Miraboreasu on 26 Sep 2022
Thanks, but I didn't get it, so what is the displacement of the trangle in the normal direction?
Benjamin Thompson on 27 Sep 2022
Your three points define the three vertices of a triangle. The triangle defines a plane, and the plane has exactly one vector normal to the plane in 3D space. If you have some other definition of your problem please provide more information.

Chunru on 27 Sep 2022
% In order to know the normal of triangle, you need the coordinated of
% triangle
postri = randn(3, 3) % x y z
postri = 3×3
-0.9491 1.4871 -1.1664 1.4412 0.2814 -0.5315 -0.9436 0.0967 0.3828
v = diff(postri) % p2-p2, p3-p2 as vector
v = 2×3
2.3903 -1.2057 0.6349 -2.3848 -0.1848 0.9143
vnorm = cross(v(1,:), v(2,:)) % norm to the triangle
vnorm = 1×3
-0.9850 -3.6995 -3.3170
vnorm = vnorm/norm(vnorm) % normalized
vnorm = 1×3
-0.1945 -0.7303 -0.6548
d1 = [0.000131475 -0.000706995 0.000754736];
d2 = [ 6.02E-05 -0.000662299 0.000711364];
d3 = [0.000147876 -0.000661116 0.000729507];
% movement of node along the normal direction of the triangle
m1 = d1*vnorm' % dot product
m1 = -3.4454e-06
m2 = d2*vnorm'
m2 = 6.1727e-06
m3 = d3*vnorm'
m3 = -2.3621e-05

John D'Errico on 27 Sep 2022
A highly confusing question. You talk about a triangle, but you do not tell us the coordinates of the triangle, only the displacements. Or, perhaps what you call displacements ARE the coordinates of the triangle.
So I will assume that you KNOW the coordinates of the triangle. What then can you say about the displacement of the triangle itself? First, what is the normal to the triangle. Since you have not told us the triangle coordinates, we cannot know. SIGH.
The normal vector to triangle is simple. You can get it form a vector cross product. That is, if the vertices of the trianlge lie at coordinates in space of A, B, and C, then the normal vector is given by
nrmlVec = cross(B-A,C-A);
nrmlVec= nrmlVec/norm(nrmlVec); % normalize to unit length
But this has NOTHING to do with the displacement of the entire triangle, or in what direction the displacement happened.
As well, the normal vector to the tiangle may point in one of two completely distinct directions. Think of them as up or down, in or out, whatever. But the normal vector is NOT unique in that respect. The direction is arbitrary.
And, really, you cannot say anything about the displaceent of the entire triangle. For example, two nodes might go in one direction, and the other node in a completely different direction.
At best, you might decide to look at the centroid of the triangle, and think about where it is going.
The centroid of the triangle is easy to work with. We can get that centroid displacement as simply the average of the three nodal displacements, thus
dCent = (d1 + d2 + d3)/3;
Now, we can consider how much of that displacement lies in the normal direction. This is easy, since nrmlVec has been unit normalized.
dCentNrml = nrmlVec*dot(dCent,nrmlVec); % normal displacement
dCentInPlane = dCent - dCentNrml; % the in-plane component at the movement of the triangle centroid
However, there is still another issue. The entire triangle may have grown larger or smaller, while not effectively moving at all. Again, this can be quantified, but you never asked about it at all. And since I don't even know for sure what is your real question, sigh.
##### 3 CommentsShow 1 older commentHide 1 older comment
John D'Errico on 27 Sep 2022
I was merely trying to say the displacement of a triangle is difficult to define, since it is almost certainly changing shape if the nodes are moving essentially independently. Even in context of a FEM, the nodes will move together, but not all in the same way.
For example, one node moving inwards, while the other nodes moving outwards. The triangle can change shape. It might just be growing in size. You can quantify all of these things of course, but there are many ways the triangle can change that are not shown by how the centroid of the triangle moves.
Chunru on 28 Sep 2022
Under the assumption of small displacement (in comparison with the triangle size), the displacement of the corner nodes may give enough information of the movement of the triangle.

### Categories

Find more on Surface and Mesh Plots in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://www.mathworks.com/matlabcentral/answers/1812140-get-the-displacement-component-which-is-perpendicular-to-the-triangle-finite-element?s_tid=srchtitle", "fetch_time": 1719059477000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2024-26/segments/1718198862396.85/warc/CC-MAIN-20240622112740-20240622142740-00761.warc.gz", "warc_record_offset": 769854012, "warc_record_length": 33967, "token_count": 1801, "char_count": 6222, "score": 3.734375, "int_score": 4, "crawl": "CC-MAIN-2024-26", "snapshot_type": "latest", "language": "en", "language_score": 0.7977590560913086, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00003-of-00064.parquet"}