# Parameter Study: Normailzation of output vectors

Hi,
I am performing a parameter study. My problem is that I would like to
get the angle between to output vectors. Therefor I need to normalize
both of them. I Tried something like this.

AnyOutputFun Vec1 = {
Val = .Model.HumanModel.Left.Leg.Jnt.Hip.Constraints.Reaction.Fout;
};

`````` AnyOutputFun Angle = {
Val = acos({0,0,1}*.Vec1()'/vnorm(.Vec1()));
``````

};

As “.Model.HumanModel.Left.Leg.Jnt.Hip.Constraints.Reaction.Fout;” is
equal to zero during model loading, I get this error message:" ‘/’ :
Division by zero".

I could imagine some circuitous workarounds in order to calculate the
angle, but maybe you know an easy way.

Thanks a lot
Peter

Hello Peter,

Although not a perfect solution, you can do something like this and it works
fine:

AnyOutputFun Angle = {
Val = acos({0,0,1}*.Vec1()’/(vnorm(.Vec1())+0.00000001));
};

Have a good day,

Jean-Olivier Racine

Nexgen Ergonomics Inc.

http://www.nexgenergo.com/

From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com] On Behalf
Of peter.belei
Sent: Friday, March 14, 2008 4:22 AM
To: anyscript@yahoogroups.com
Subject: [AnyScript] Parameter Study: Normailzation of output vectors

Hi,
I am performing a parameter study. My problem is that I would like to
get the angle between to output vectors. Therefor I need to normalize
both of them. I Tried something like this.

AnyOutputFun Vec1 = {
Val = .Model.HumanModel.Left.Leg.Jnt.Hip.Constraints.Reaction.Fout;
};

AnyOutputFun Angle = {
Val = acos({0,0,1}*.Vec1()’/vnorm(.Vec1()));
};

As “.Model.HumanModel.Left.Leg.Jnt.Hip.Constraints.Reaction.Fout;” is
equal to zero during model loading, I get this error message:" ‘/’ :
Division by zero".

I could imagine some circuitous workarounds in order to calculate the
angle, but maybe you know an easy way.

Thanks a lot
Peter

[Non-text portions of this message have been removed]

The solution is not perfect, but good enough for me. Thank you.

— In anyscript@yahoogroups.com, Jean-Olivier Racine <joracine@…>
wrote:
>
> Hello Peter,
>
>
>
> Although not a perfect solution, you can do something like this and
it works
> fine:
>
>
>
> AnyOutputFun Angle = {
> Val = acos({0,0,1}.Vec1()’/(vnorm(.Vec1())+0.00000001));
> };
>
>
>
> Have a good day,
>
>
>
> Jean-Olivier Racine
>
> joracine@…
>
>
> Nexgen Ergonomics Inc.
>
> http://www.nexgenergo.com/
>
>
>
> From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com]
On Behalf
> Of peter.belei
> Sent: Friday, March 14, 2008 4:22 AM
> To: anyscript@yahoogroups.com
> Subject: [AnyScript] Parameter Study: Normailzation of output vectors
>
>
>
> Hi,
> I am performing a parameter study. My problem is that I would like to
> get the angle between to output vectors. Therefor I need to normalize
> both of them. I Tried something like this.
>
> AnyOutputFun Vec1 = {
> Val = .Model.HumanModel.Left.Leg.Jnt.Hip.Constraints.Reaction.Fout;
> };
>
> AnyOutputFun Angle = {
> Val = acos({0,0,1}
.Vec1()’/vnorm(.Vec1()));
> };
>
> As “.Model.HumanModel.Left.Leg.Jnt.Hip.Constraints.Reaction.Fout;” is
> equal to zero during model loading, I get this error message:" ‘/’ :
> Division by zero".
>
> I could imagine some circuitous workarounds in order to calculate the
> angle, but maybe you know an easy way.
>
> Thanks a lot
> Peter
>
>
>
>
>
> [Non-text portions of this message have been removed]
>