Solved

arrow head

Posted on 2007-04-01
12
203 Views
Last Modified: 2013-12-26
Hi,

I've asked this question a few times but still can't understand the answers. I need a really dumbed down answer.

I have two points in 3D space:

    Point1: (x,y,z)
    Point2: (x,y,z)

I want to draw an arrow from point1 to point2. At point2 I'd like to draw a pyramid cap to mimic an arrow head. So I need to know how to generate an additional 4 points that are equally distributed around point 2 - if I connect them all to point 2 it will look like a pyramid whose tip is point2.

Can someone please tell me how to fill this in then (the four generated base points of the pyramid arrow head):

    base_pt_0 = (x,y,z);
    base_pt_1 = (x,y,z);
    base_pt_2 = (x,y,z);
    base_pt_3 = (x,y,z);

If it is any easier - I could also draw a cone shape for the arrow head - i guess just like 16 points or so evenely distributed around point 2.

Thanks
0
Comment
Question by:DJ_AM_Juicebox
  • 7
  • 5
12 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 18834316
Did you not get the answer from the previous question?
It looks like you also want to move the points around point2 a little bit back toward point1, so add (point2-point1)*(1-(arrowhead length)/(line length)) to each of those points.
to add intermediate points, you can use
(Point1-Point2) × (Point0-Point2)  * sin(45º)
+
 (Point1-Point2) × (PointA-Point2) * cos(45º)
for every 22.5º
0
 

Author Comment

by:DJ_AM_Juicebox
ID: 18834362
What is point0 again?
0
 
LVL 84

Expert Comment

by:ozo
ID: 18834578
point0 can be any point not along the line through point1 and point2
perpendicular0 = (Point1-Point2) × (Point0-Point2)
perpendicular1 = perpendicular0*(radius of cone)/|perpendicular0|
perpendicular2 = perpendicular0 × (Point1-Point2) / |Point1-Point2|
pontx = point2+(point1-point2)*(length of cone)/|Point1-Point2| + sin(x)*perpendicular1+cos(x)*perpendicular2
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:DJ_AM_Juicebox
ID: 18836296
Ok so I get these 3 perpendiculars -

then you show me that I will get this 'pointx' -

do you mean that pointx is just any point that can be generated that will be at the base of the head (I just substitute in for 'x' a number between 0 - 360, depending on how many points I want in the base)?

Thanks
0
 
LVL 84

Expert Comment

by:ozo
ID: 18839930
yes
0
 

Author Comment

by:DJ_AM_Juicebox
ID: 18861727
Hi ozo,

I finally got a chance to give it a try. A few questions:

1)   perpendicular1 = perpendicular0*(radius of cone)/|perpendicular0|
 what do I do here when a component of perpendicular0 is zero?

2) perpendicular2 = perpendicular0 × (Point1-Point2) / |Point1-Point2|
here if I put parenthesis in the equation it should be:

    perpendicular2 = (perpendicular0 × (Point1-Point2)) / |Point1-Point2|

I don't know if cross product has a higher precedence than division.


Thanks
0
 
LVL 84

Expert Comment

by:ozo
ID: 18862409
|perpendicular0| will be 0 only if Point0, Point1, and Point2 are all on the same line
which is why Point0 can't be on that line.
individual components of perpendicular0 can be 0, in which case the corresponding component of perpendicular1 will be 0

It doesn't matter where you put the parenthesis, the result will be the same.
0
 

Author Comment

by:DJ_AM_Juicebox
ID: 18863161
ok dumb question, but is there some guaranteed way of picking a point not coliear to point 1 and 2?
0
 
LVL 84

Expert Comment

by:ozo
ID: 18863185
At least one of Point1 + (1,0,0) and Point1+(0,1,0)
will not be colinear to point 1 and 2.
0
 
LVL 84

Expert Comment

by:ozo
ID: 18863418
If you take any three non-colinear points, at least one will not be not colinear to point 1 and 2
0
 

Author Comment

by:DJ_AM_Juicebox
ID: 18864782
Hi ozo,

I just picked two points in a real stuation for my arrow tail and head, they are:

    Point1(0, 159, 83);
    Point2(0, -0.3, 83);

Now I'm just manually choosing a non collinear point for poin0 of:

    Point0(10, 10, 0);

but still it gives me zero in the components with this formula:

    perpendicular0 = (Point1-Point2) × (Point0-Point2)

perpendicular0 will turn out to be:

      perpendicular0 = (13320, 0, 1600)

am I doing something wrong?

Thanks
0
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 18868112
I get (13221.9, 0, 1593)
but that's close enough
A zero component is not a problem as long as they are not all zero
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Binomial distribution 2 63
Auto Adjust Percent rate 5 56
Math equations 13 58
What is CANH and CANL voltage when CAN Trasceiver is in sleep mode ? 2 19
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
When we purchase storage, we typically are advertised storage of 500GB, 1TB, 2TB and so on. However, when you actually install it into your computer, your 500GB HDD will actually show up as 465GB. Why? It has to do with the way people and computers…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question