root / src / sinangle.f90
Historique | Voir | Annoter | Télécharger (1,75 ko)
1 |
FUNCTION SinAngle(v1x,v1y,v1z,norm1,v2x,v2y,v2z,norm2) |
---|---|
2 |
!---------------------------------------------------------------------- |
3 |
! Copyright 2003-2014 Ecole Normale Supérieure de Lyon, |
4 |
! Centre National de la Recherche Scientifique, |
5 |
! Université Claude Bernard Lyon 1. All rights reserved. |
6 |
! |
7 |
! This work is registered with the Agency for the Protection of Programs |
8 |
! as IDDN.FR.001.100009.000.S.P.2014.000.30625 |
9 |
! |
10 |
! Authors: P. Fleurat-Lessard, P. Dayal |
11 |
! Contact: optnpath@gmail.com |
12 |
! |
13 |
! This file is part of "Opt'n Path". |
14 |
! |
15 |
! "Opt'n Path" is free software: you can redistribute it and/or modify |
16 |
! it under the terms of the GNU Affero General Public License as |
17 |
! published by the Free Software Foundation, either version 3 of the License, |
18 |
! or (at your option) any later version. |
19 |
! |
20 |
! "Opt'n Path" is distributed in the hope that it will be useful, |
21 |
! but WITHOUT ANY WARRANTY; without even the implied warranty of |
22 |
! |
23 |
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
24 |
! GNU Affero General Public License for more details. |
25 |
! |
26 |
! You should have received a copy of the GNU Affero General Public License |
27 |
! along with "Opt'n Path". If not, see <http://www.gnu.org/licenses/>. |
28 |
! |
29 |
! Contact The Office of Technology Licensing, valorisation@ens-lyon.fr, |
30 |
! for commercial licensing opportunities. |
31 |
!---------------------------------------------------------------------- |
32 |
|
33 |
use Path_module, only : KREAL |
34 |
|
35 |
IMPLICIT NONE |
36 |
|
37 |
real(KREAL) :: v1x,v1y,v1z,norm1 |
38 |
real(KREAL) :: v2x,v2y,v2z,norm2 |
39 |
real(KREAL) :: SinAngle |
40 |
|
41 |
if (norm1<=1d-6) STOP "ERROR in SinAngle, norm1<=1e-6" |
42 |
if (norm2<=1d-6) STOP "ERROR in SinAngle, norm2<=1e-6" |
43 |
Sinangle=sqrt(1.-((v1x*v2x+v1y*v2y+v1z*V2z)/(norm1*norm2))**2) |
44 |
|
45 |
|
46 |
END FUNCTION SINANGLE |