Let's see, i did it using some basic math, but maybe there's a simpler
way.
For simplification, let's say you are working on 2D and the XY plane,
so you have the following equation:
a = X*b + Y*c
where 'a' is the initial vector, and 'b' and 'c' are the two unit
vectors you want to find the magnitude (right now they are unit
vectors).You want to find X and Y.

Since we are in 2d we have two numbers for every vector (x and y
coordinates), so we actually have two formulas:
a.x = X*b.x + Y*c.x
and
a.y = X*b.y + Y*c.y
Using substitution you get the following equations:
(a.y -a.x*c.y/c.x)/(-b.x*c.y/c.x + b.y) for X
(a.y -a.x*b.y/b.x)/(-c.x*b.y/b.x + c.y) for Y
Place this formulas into expression components, then use the magnitude
or multiply vector components to create the two final components.

The 3 vectors must be on the same plane, but maybe they are not in the
XY plane. For this i would use the 'orient' component to bring them to
the x,y plane and then use it again to bring them back to its initial
position.

There's probably a way of doing this using the vector components
without so much equation, I'm not sure.

On Dec 30, 9:58 pm, basbasbas <[email protected]> wrote:
> Dear Visose,
>
> I want to decompose it to two vectors not oriented to world
> coordinates and generaly not perpendicular to my vector.
>
> Cheers,
> Bas
>
> On 30 dec, 20:27, visose <[email protected]> wrote:
>
> > What exactly are you trying to achieve?
> > You want to decompose the vector into two other perpendicular vectors?
> > like when you want to calculate a diagonal force you decompose it in X
> > and Y forces. You want to decompose it to vectors not oriented to
> > world coordinates?
> > You want to get the magnitude of one vector, divide it by 2, and apply
> > it to two other vectors no matter what the direction of the first
> > vector is?
> > or something else?
>
> > If it's the first case it's easy, since vectors in grasshopper (and
> > rhino) are defined by 3 perpendicular components (x,y,z) and not by
> > magnitude and angle, you just need to use the 'decompose vector'
> > component, no need to do any trigonometry.
>
> > On Dec 30, 6:10 pm, basbasbas <[email protected]> wrote:
>
> > > Hi,
>
> > > I have a vector that I want to divide into two new vectors with known
> > > directions. What is the best way to proceed?
>
> > > Cheers,
> > > Bas Goris

Reply via email to