From 523bf18206f550a315c6c17e5a0a253381b0f8bf Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@fe.uni-lj.si>
Date: Thu, 07 Jun 2012 11:16:16 +0000
Subject: [PATCH] Spherical harmonics. Almost everyhing is done. Missing triangle area calculation when vertex is moved or bond is flipped. Also missing volume calculation on vertex move or bondflip. Calculation of co coefficient is not done completely yet. Problems are in numbering the coefficients. Newly added data structure ts_spharm is referenced from ts_vesicle. Missing function for initialization and freeing the memory of that datastructure -- but that memory is already used by some functions.

---
 src/shdiscover.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/shdiscover.c b/src/shdiscover.c
index f16239f..008d522 100644
--- a/src/shdiscover.c
+++ b/src/shdiscover.c
@@ -42,17 +42,17 @@
 
 /*we calculate new position of each vertex of vesicle */
 for(i=0;i<n;i++){
-	fi=atan2(vlist->vtx[i]->data->y, vlist->vtx[i]->data->x);
+	fi=atan2(vlist->vtx[i]->y, vlist->vtx[i]->x);
 /*	theta=atan2(
 	    sqrt(vlist->vtx[i]->data->x*vlist->vtx[i]->data->x + 
 		vlist->vtx[i]->data->y*vlist->vtx[i]->data->y),
 		vlist->vtx[i]->data->z 
 	    ); */
 	theta=acos(
-		vlist->vtx[i]->data->z /
-	    sqrt(vlist->vtx[i]->data->x*vlist->vtx[i]->data->x + 
-		vlist->vtx[i]->data->y*vlist->vtx[i]->data->y+
-		vlist->vtx[i]->data->z*vlist->vtx[i]->data->z)
+		vlist->vtx[i]->z /
+	    sqrt(vlist->vtx[i]->x*vlist->vtx[i]->x + 
+		vlist->vtx[i]->y*vlist->vtx[i]->y+
+		vlist->vtx[i]->z*vlist->vtx[i]->z)
 
 		);
 
@@ -67,9 +67,9 @@
 		/*ts_fprintf(stdout,"l=%d, m=%d, u=%s\n",l,m,argv[j]);*/
 	}
 
-	vlist->vtx[i]->data->z=fabs(r)*cos(theta);
-	vlist->vtx[i]->data->x=fabs(r)*sin(theta)*cos(fi);
-	vlist->vtx[i]->data->y=fabs(r)*sin(theta)*sin(fi);
+	vlist->vtx[i]->z=fabs(r)*cos(theta);
+	vlist->vtx[i]->x=fabs(r)*sin(theta)*cos(fi);
+	vlist->vtx[i]->y=fabs(r)*sin(theta)*sin(fi);
 }
 
 write_vertex_xml_file(vesicle,0);

--
Gitblit v1.9.3