diff options
author | Valerio Mariani <valerio.mariani@desy.de> | 2016-10-07 15:51:09 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2016-10-10 15:22:02 +0200 |
commit | 4f07772dd69b087afc6fed7da08452cc12e39fc6 (patch) | |
tree | 441326d5e1f6a54d90cd1b202023533449bad100 /src/geoptimiser.c | |
parent | c38d40c4f9613785afe172c32940ea677c0469d2 (diff) |
Fixed bug with positioning of secondary ASICs
Diffstat (limited to 'src/geoptimiser.c')
-rw-r--r-- | src/geoptimiser.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/geoptimiser.c b/src/geoptimiser.c index 0b028c7a..e0337358 100644 --- a/src/geoptimiser.c +++ b/src/geoptimiser.c @@ -1078,15 +1078,17 @@ static void correct_rotation_and_stretch(struct rg_collection *connected, } else { struct panel *p0; - double delta_x, delta_y; + double delta_x, delta_y, delta; p0 = connected->rigid_groups[di]->panels[0]; delta_x = p->cnx - p0->cnx / cs; delta_y = p->cny - p0->cny / cs; - new_cnx = p0->cnx + delta_x; - new_cny = p0->cny + delta_y; + delta = sqrt(delta_x*delta_x + delta_y*delta_y); + + new_cnx = p0->cnx + delta*p0->fsx; + new_cny = p0->cny + delta*p0->fsy; } |