in reply to Re^3: The problem of getting the unit vector "Undefined subroutine &main::Normalize"
in thread The problem of getting the unit vector "Undefined subroutine &main::Normalize"
That's cool, buddy! I am trying to obtain the unit vector of the dipole moment (a vector) using sub Normalize.
# get dipole moment my $dipoleMoment = $setMolecule->DipoleMoment; # get the unit vector of dipole moment my $direction=Normalize($dipoleMoment);
unit vector=±a/|a|. For example, if I want to have the unit vector of (2,-3,6), the calculation process is unit vector=±(2,-3,6)/√4+9+36=±(2/7,-3/7,6/7).
$dipoleMoment is a vector with (X, Y, Z), I am trying to have the unit vector of $dipoleMoment, would you please write sub Normalize to fulfill this calculation?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: The problem of getting the unit vector "Undefined subroutine &main::Normalize"
by NetWallah (Canon) on Sep 01, 2017 at 05:31 UTC | |
|
Re^5: The problem of getting the unit vector "Undefined subroutine &main::Normalize"
by roboticus (Chancellor) on Aug 31, 2017 at 17:07 UTC | |
by windcrazy86 (Novice) on Aug 31, 2017 at 20:34 UTC | |
|
Re^5: The problem of getting the unit vector "Undefined subroutine &main::Normalize"
by Anonymous Monk on Aug 31, 2017 at 17:06 UTC | |
by windcrazy86 (Novice) on Aug 31, 2017 at 20:39 UTC |