[hvgl] Reduce a complex multiplication

This commit is contained in:
Behdad Esfahbod committed 2025-03-02 17:03:51 -07:00
1 parent b13c81276b
commit 186e9c8f44
1 file changed
+1 -3
+1 -3
View File
@@ -379,8 +379,6 @@ PartComposite::apply_to_coords (hb_array_t<double> out_coords,
}
}
static constexpr std::complex<double> complex_i {0, 1};
void
PartComposite::apply_to_transforms (hb_array_t<hb_transform_t<double>> transforms,
hb_array_t<const double> coords) const
@@ -497,7 +495,7 @@ PartComposite::apply_to_transforms (hb_array_t<hb_transform_t<double>> transform
if (extremum_rotation_delta)
{
std::complex<double> t {(double) extremum_translation_delta.x, (double) extremum_translation_delta.y};
std::complex<double> _1_minus_e_iangle = 1. - std::exp (complex_i * (double) extremum_rotation_delta);
std::complex<double> _1_minus_e_iangle = 1. - std::exp (std::complex<double> (0, (double) extremum_rotation_delta));
std::complex<double> eigen = t / _1_minus_e_iangle;
double center_x = eigen.real ();
double center_y = eigen.imag ();