 # how to - lines at 90 degrees

i want to make a small script but need to do some lines at 90 degress

is there some pre define functions that can help in doing so and how to use theses?

see pic heres of the model

i need the blue line at 90 degress but also split in 2 the L2 lines

i do have all vertices of the tangeant on the rigth at angle with the blue line

Thanks for a ny help

I cannot see how your diagram has enough constraints to determine a perpendicular line. However, if the lines are all in the same xz plane then you can generate a perpendicular line to L1 and the y axis by taking the cross product of these two vectors.

well cross product does make a 90 degress perpendi… but in Z

i was tinking more of the mathutil intersect option i guess

cause it has to stay in 2D - for this model

mind you i’d like to have the equivalent for 3D too - might be usefll in futur

any simple example using the intersect of mathutil woild be a good start

i can give more details on the sequence of calculations for the model in mind
if that can help

like if you have a line in space and with python you want to find the middle of this line
is there any simple way of doing this - may be one of the calss in mathutil?

Thanks

Cross-product will make it perpendicular where ever you want, just choose the correct vector to use as the cross product. For instance if you want the result in the xz plane choose (0,1,0) as the other vector.

To determine the middle of a line defined by two endpoints that is two vertices, add them together and divide by 2.

(Vector((1,2,0))+Vector((0,1,2)))/2.0
NB you cannot add lists this way, only the Vectors in mathutils

I am not sure of your expertise here, but an introductory course on elementary vector algebra, such as the first couple of lectures here, may be useful:

or here:

golum.riv.csu.edu.au/~igarbett/BrElVecAlg.pdf

i thnk i know some things about vectors - but a little rusted over time

like this intercept can do intercept considering the lines has beingh infinite
whhhc is nice and now i fond the way to make it work and it’s fine!

but i still wold like to see a good tut on what else is available with some good example
shoiwng how to write things - i did not find any good tut up to now
so i guess the forum is the right place to ask questions about it

anyway for the model i found an alternative way for some of the calculations in 2D
and it’s working with lot’s off cos sin and tan ect…
it would be nice to see other pre define functions in python for theses type of calcualtions

Thanks

The geometry module may have a few useful functions
http://www.blender.org/documentation/249PythonDoc/index.html