/**
 * aran_development3d_l2l_rotate:
 * @src_node: @src tree node info.
 * @src: an #AranDevelopment3d.
 * @dst_node: @dst tree node info.
 * @dst: an #AranDevelopment3d.
 *
 * Performs local 2 local translation between @src and @dst with the
 * "Point and Shoot" technique: rotate @src to @dst_node->center direction and
 * then translate the rotated series along the Z axis. Rotate it back and
 * accumulate it into dst. These operations lead to a O(p^3) scheme.
 */
void aran_development3d_l2l_rotate (const VsgPRTree3dNodeInfo *src_node,
                                    AranDevelopment3d *src,
                                    const VsgPRTree3dNodeInfo *dst_node,
                                    AranDevelopment3d *dst)
{
  aran_spherical_seriesd_translate_rotate (src->local, &src_node->center,
                                           dst->local, &dst_node->center);
}
Exemple #2
0
int main (int argc, char **argv)
{
  int ret = 0;
  AranSphericalSeriesd *ass;
  AranSphericalSeriesd *ast;
  AranSphericalSeriesd *ast2;
  AranSphericalSeriesd *ast3;

  parse_args (argc, argv);

  p.x = 3.;
  p.y = -1.;
  p.z = -1.;

  ass = create_newton (deg, &center);

/*   aran_spherical_seriesd_write (ass, stderr); */
/*   g_printerr ("\n\n"); */
  check ("devel", ass, 1., &center, newtongrad);

  ast = aran_spherical_seriesd_clone (ass);
  aran_spherical_seriesd_set_zero (ast);

  aran_spherical_seriesd_translate (ass, &center, ast, &tr);

/*   aran_spherical_seriesd_write (ast, stderr); */
/*   g_printerr ("\n\n"); */
  check ("translated", ast, 0.5, &tr, newtongrad);

  ast2 = aran_spherical_seriesd_clone (ass);
  aran_spherical_seriesd_set_zero (ast2);

  aran_spherical_seriesd_translate_kkylin (ass, &center, ast2, &tr);

/*   aran_spherical_seriesd_write (ast2, stderr); */
/*   g_printerr ("\n\n"); */
  check ("translated kkylin", ast2, 0.5, &tr, newtongrad);

  ast3 = aran_spherical_seriesd_clone (ass);
  aran_spherical_seriesd_set_zero (ast3);

  aran_spherical_seriesd_translate_rotate (ass, &center, ast3, &tr);

/*   aran_spherical_seriesd_write (ast3, stderr); */
/*   g_printerr ("\n\n"); */
  check ("translated rotate", ast3, 0.5, &tr, newtongrad);

  aran_spherical_seriesd_free (ass);
  aran_spherical_seriesd_free (ast);
  aran_spherical_seriesd_free (ast2);
  aran_spherical_seriesd_free (ast3);

  return ret;
}