Move object along vector

How do I calculate the move of an object off of the vector of two given points?

The 2 green points are the main ends.
I want to move the yellow point perpendicular to the green points by an amount of X

http://www.scriptspot.com/files/vector.png

AttachmentSize
vector.png2.35 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
JokerMartini's picture

start

(
	radiusX = 30.0
	radiusY = 20.0
	offset = 10.0
 
	delete objects
 
	clearlistener()
	/* Create Corner Points */
	startPt = point pos:[0,0,0] wirecolor:blue size:4
	endPt = point pos:[radiusX,radiusY,0] wirecolor:blue size:4
 
	center = (endPt.pos + startPt.pos)/2
 
 	nvec = (normalize endPt.pos)
 	d = (distance endPt.pos startPt.pos)/2 + offset	
 	point pos:(nvec*(d)) size:2 wirecolor:white
 
 
	circle pos:center radius:((distance startPt.pos endPt.pos)/2) wirecolor:red
)

John Martini
Digital Artist
http://www.JokerMartini.com (new site)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.