fixup: normalize vector to satellite

This commit is contained in:
Tim Schubert 2020-07-29 09:46:45 +02:00
parent 3fb0969930
commit f6786c3a66
2 changed files with 4 additions and 3 deletions

View file

@ -46,8 +46,9 @@ LeoPropagationLossModel::~LeoPropagationLossModel ()
double
LeoPropagationLossModel::GetAngle (Ptr<MobilityModel> a, Ptr<MobilityModel> b)
{
Vector3D pa = a->GetPosition ();
Vector3D pa = a->GetPosition () - b->GetPosition ();
Vector3D pb = b->GetPosition ();
pb = Vector3D (-pb.x, -pb.y, -pb.z);
double prod = abs ((pa.x * pb.x) + (pa.y * pb.y) + (pa.z * pb.z));
double norm = pb.GetLength () * pa.GetLength ();