Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi,
I'm trying to figure out the math for something that I did in CAD. Eventually, I have to code it in Fortran. However, I thought I should try in Mathcad first. I found some websites and tried to use the information they provided. For their inputs, I get their answers. However, when I try to use the real inputs from the CAD model it's way off and doesn't seem to make any sense. I'm not sure what I'm doing wrong. This isn't a Mathcad issue, just me trying to figure out the math.
From what I can tell this is the point normal form of intersecting planes. I actually know what the surface normals are. But the values I'm getting from the math don't match at all. Ultimately, I need to figure out the angle between the intersecting line and the local xy plane (rather than the global xy plane). I tried to provide some pictures. I have triple checked my inputs and don't see any issues there. I suspect my math is not right, but I have no idea why.
Anthony
Solved! Go to Solution.
Its unclear to me what your three picture should show and it sure would help if you would describe what exactly you a re trying to calculate in your Mathcad sheet.
BTW, to apply a certain distance (dist1:=2 in your sheet) along a direction (possibly n3 in your sheet) you have to use the unit vector in n3 direction (n3/|n3|). The point you calculated sure IS a point on the intersection line of the planes (P1,P2,P3) and (P1;P5,P6) but its distance from P1 sure is not 2 but something in the range of 1034.
n4*(p8-p7) should be zero and what you experience are round-off errors. Not sure why you call it "way off". You may set the zero threshold from the default 15 down to 12 to see a nice zero here 😉
Afterthought: I guess your problem can be solved by simply using the unit vector as described above:
Its unclear to me what your three picture should show and it sure would help if you would describe what exactly you a re trying to calculate in your Mathcad sheet.
BTW, to apply a certain distance (dist1:=2 in your sheet) along a direction (possibly n3 in your sheet) you have to use the unit vector in n3 direction (n3/|n3|). The point you calculated sure IS a point on the intersection line of the planes (P1,P2,P3) and (P1;P5,P6) but its distance from P1 sure is not 2 but something in the range of 1034.
n4*(p8-p7) should be zero and what you experience are round-off errors. Not sure why you call it "way off". You may set the zero threshold from the default 15 down to 12 to see a nice zero here 😉
Afterthought: I guess your problem can be solved by simply using the unit vector as described above:
thanks a lot. you figured it out. sorry the pics aren't clear. it's hard to even understand in cad let alone get a good screen shot. i wasn't referring to the round off error. but the normals coming out were not even close to the values i had in cad. ironically, i had previously tried your fix on the cad values but it never occurred to me to try on the values from the math. i'll try that next. i suspect they will match now.
update;
the only problem remaining is the normal vector of the surface, from the math, still isn't matching what i have in cad. the part where i said they aren't even close refers to n4 compared to n4a or n4b. also n5 vs n5a or n5b. the difference in a and b was direction. i tried the opposite of what i thought the normal was in cad. but that is only changing the signs. the magnitudes are what are way off. if i use what you showed on n4 and n5 they still don't match. i'd like to figure that out since it would be a lot easier for me to use the known normals than to calculate them from the points.
oh, i got lucky and figured it out. if i use what you showed and multiply by the known length of the surface normal it then matches. so i can now get n4 to match 4a and n5 to match n5a. this will let me continue. thanks for your help. i guess in what i was reading, the definition of surface normal wasn't what i thought it would be. their definition comes out with units of meters squared. so that let me figure out the problem. if i divide by the magnitude to get a unit normal and then multiply by the known normal length, i get the agreement i was looking for.
i attached an updated version, in case it helps anyone.
Glad that you are now up and running and your problem is solved.
There is no such thing as THE normal vector of a plane - there are an infinite number of normal vectors - two of them with length 1.
The cross product of two vectors of the plane give you one of those many possible normal vectors and its magnitude equals the area enclose in the parallelogram defined by the two initial vectors. The orientation of the vector depends on the order you use when you take the cross product - "a x b" or "b x a" - which just means a change of the sign(s).
I don't know where your "known normal length" stems from, but of course you get a vector of just that magnitude if you multiply a unit vector by this number.
thanks again werner,
that makes sense. yeah, the websites got me confused as they are showing the surface normals in a way that comes back with units of mm^2 where it looks like it's better if it's unitless. in the equation you fixed, you made it unitless to work. so i got my specific example working. however, for the textbook examples it would give different results. they don't work with any units and don't mention this issue. i'm not sure if when they say surface normals they mean the unitless ones or the ones with units. in any event, i definitely got enough information to move forward now. i don't need to match the textbook examples. matching the cad model is what i have to do.
the cad model has lengths to the surface normals because they are for a specific geometry (airfoil oriented oddly in 3D space). you are right, they could have any length, but that wouldn't make sense in the context of the problem. the only vector that length doesn't matter is the one i'm trying to calculate. i'll have to pick a suitable length for that. just something that plots it in view of all the other vectors. the websites call that 'parameter t'. but in looking into it more, it appears to be a length or distance of the intersecting line.