# Thread: Vector returned when value is above a certain value

1. ## Vector returned when value is above a certain value

I am trying to figure out what a function or operator should be that when multiplied by a scalar returns a scalar of the same value - when the scalar is above a certain value - and when the value is lower it returns a vector, with component values of a nominated value.

It's a tricky one..

2. ## Re: Vector returned when value is above a certain value

Hey asmodelle.

What you could do is define a bi-vector that contains a vector component and a scalar component.

You have a function that sets the vector component and you have a function that returns the scalar component. This is actually done in geometric algebra and the idea goes back to Grassmann who pioneered the subject.

You could also just define a vector with one more dimension where if the value is 1 you return a vector with a j and k component and if zero you just return the component for the i vector.

There are a few ways to do this kind of thing.