- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear intel users
I need to change this code for calculate one peroperties in two dimensions (xy plan) not in three dimensions (xyz), in first step I changed in line 218:
rsq=rmsx**2+rmsy**2+rmsz**2 ----> rsq=rmsx**2+rmsy**2
but I get output data that is wrong.
please help me.
I need to change this code for calculate one peroperties in two dimensions (xy plan) not in three dimensions (xyz), in first step I changed in line 218:
rsq=rmsx**2+rmsy**2+rmsz**2 ----> rsq=rmsx**2+rmsy**2
but I get output data that is wrong.
please help me.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It stands to reason that changing an expression in the source code changes the results of the subroutine that you showed.
As for "data that is wrong", you have given us no background as to what is "right" and what is "wrong". It is unlikely that one can answer your question without more information about the problem since, based on what you have displayed, everything appears to be in fine fettle!
As for "data that is wrong", you have given us no background as to what is "right" and what is "wrong". It is unlikely that one can answer your question without more information about the problem since, based on what you have displayed, everything appears to be in fine fettle!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you want tocalculate a length of a vector in 2-D?
If No, please provide more details about your problem.
If Yes, from equations you provided I can see that:
- Original expression looks like a squared length of a vector in 3-D. In another form:
If an origin of a vector is P1(X1,Y1,Z1) and end of a vector is P2(X2,Y2,Z2), then squared length is
d^2 = dX^2 + dY^2 + dZ^2 = (X2-X1)^2 + (Y2-Y1)^2 + (Z2-Z1)^2,
- Modified expression looks like a squared length of a vector in 2-D. In another form:
If an origin of a vector is P1(X1,Y1) and end of a vector is P2(X2,Y2), then squared length is
d^2 = dX^2 + dY^2 = (X2-X1)^2 + (Y2-Y1)^2.
Try these simple test-cases:
- 3-D: P1(2,-1,-5) and P2(4,-3,1) ->
d^2 = (4-2)^2 + (-3+1)^2 + (1+5)^2 = 4 + 4 + 36 = 44 => d = 44^1/2 = 2 * 11^1/2 = 6.6332...
- 2-D: P1(2,-1) and P2(4,-3) ->
d^2 = (4-2)^2 + (-3+1)^2 = 4 + 4 = 8 => d = 8^1/2 = 2 * 2^1/2 = 2.8284...
Best regards,
Sergey
If No, please provide more details about your problem.
If Yes, from equations you provided I can see that:
- Original expression looks like a squared length of a vector in 3-D. In another form:
If an origin of a vector is P1(X1,Y1,Z1) and end of a vector is P2(X2,Y2,Z2), then squared length is
d^2 = dX^2 + dY^2 + dZ^2 = (X2-X1)^2 + (Y2-Y1)^2 + (Z2-Z1)^2,
- Modified expression looks like a squared length of a vector in 2-D. In another form:
If an origin of a vector is P1(X1,Y1) and end of a vector is P2(X2,Y2), then squared length is
d^2 = dX^2 + dY^2 = (X2-X1)^2 + (Y2-Y1)^2.
Try these simple test-cases:
- 3-D: P1(2,-1,-5) and P2(4,-3,1) ->
d^2 = (4-2)^2 + (-3+1)^2 + (1+5)^2 = 4 + 4 + 36 = 44 => d = 44^1/2 = 2 * 11^1/2 = 6.6332...
- 2-D: P1(2,-1) and P2(4,-3) ->
d^2 = (4-2)^2 + (-3+1)^2 = 4 + 4 = 8 => d = 8^1/2 = 2 * 2^1/2 = 2.8284...
Best regards,
Sergey
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page