Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
The Monge point estimation

Subject: The Monge point estimation

From: Liana

Date: 3 Apr, 2011 05:53:03

Message: 1 of 6

Hello,

I'm trying to estimate the Monge point of a tetrahedron. The formula can be found here: http://en.wikipedia.org/wiki/Tetrahedron.
However, I get NaN instead of some value:
v1 = [0 15 15];
v2 = [0 0 0];
v3 = [0 12 12];
v4 = [10 10 10];
% 3 vectors - A, B, C
A = [(v2(1)-v1(1)) (v2(2)-v1(2)) (v2(3)-v1(3))];
B = [(v3(1)-v1(1)) (v3(2)-v1(2)) (v3(3)-v1(3))];
C = [(v4(1)-v1(1)) (v4(2)-v1(2)) (v4(3)-v1(3))];
mongepoint = (dot(A,cross(B,C))+dot(B,cross(C,A))+dot(C,cross(A,B)))/dot(2*A,cross(B,C));

Could someone tell me please where is my error?

Thanks a lot.

Subject: The Monge point estimation

From: Matt J

Date: 3 Apr, 2011 06:31:04

Message: 2 of 6

"Liana" wrote in message <in91vv$96c$1@fred.mathworks.com>...
>
> mongepoint = (dot(A,cross(B,C))+dot(B,cross(C,A))+dot(C,cross(A,B)))/dot(2*A,cross(B,C));
>
> Could someone tell me please where is my error?
================


You're dividing by a quantity that is equal to zero

>> dot(2*A,cross(B,C))

ans =

     0

Subject: The Monge point estimation

From: Liana

Date: 3 Apr, 2011 06:58:04

Message: 3 of 6

Thank you, Matt.

Hmm...BTW there shouldn't be zeros...it means that I'm using the formula (dot(A,cross(B,C)) in improper way... I appreciate if somebody can help me to estimate the monge point correctly. Thanks.

"Matt J" wrote in message <in9478$c4k$1@fred.mathworks.com>...
> "Liana" wrote in message <in91vv$96c$1@fred.mathworks.com>...
> >
> > mongepoint = (dot(A,cross(B,C))+dot(B,cross(C,A))+dot(C,cross(A,B)))/dot(2*A,cross(B,C));
> >
> > Could someone tell me please where is my error?
> ================
>
>
> You're dividing by a quantity that is equal to zero
>
> >> dot(2*A,cross(B,C))
>
> ans =
>
> 0

Subject: The Monge point estimation

From: Matt J

Date: 3 Apr, 2011 07:14:05

Message: 4 of 6

"Liana" wrote in message <in95ps$5bv$1@fred.mathworks.com>...
> Thank you, Matt.
>
> Hmm...BTW there shouldn't be zeros...it means that I'm using the formula (dot(A,cross(B,C)) in improper way... I appreciate if somebody can help me to estimate the monge point correctly. Thanks.
=============

It might have to do with the fact that your data don't define a tetrahedron. Your first 3 vertices, v1,v2,v3, are colinear.

Subject: The Monge point estimation

From: Bruno Luong

Date: 3 Apr, 2011 07:19:04

Message: 5 of 6

"Liana" wrote in message <in95ps$5bv$1@fred.mathworks.com>...
> Thank you, Matt.
>
> Hmm...BTW there shouldn't be zeros...it means that I'm using the formula (dot(A,cross(B,C)) in improper way... I appreciate if somebody can help me to estimate the monge point correctly. Thanks.

Your points v1, ...v4 are in the same plane. The tetrahedron is degenerated. That's why you get 0. Check your data rather than the formula.

Bruno

Subject: The Monge point estimation

From: Liana

Date: 3 Apr, 2011 19:47:04

Message: 6 of 6

Thank you, Bruno! Your comment helped me very much.

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <in9718$nas$1@fred.mathworks.com>...
> "Liana" wrote in message <in95ps$5bv$1@fred.mathworks.com>...
> > Thank you, Matt.
> >
> > Hmm...BTW there shouldn't be zeros...it means that I'm using the formula (dot(A,cross(B,C)) in improper way... I appreciate if somebody can help me to estimate the monge point correctly. Thanks.
>
> Your points v1, ...v4 are in the same plane. The tetrahedron is degenerated. That's why you get 0. Check your data rather than the formula.
>
> Bruno

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us