Skip to content

Commit eb44844

Browse files
committed
Fix documentation link & simplify construction
1 parent 1c13b8e commit eb44844

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,11 @@ impl<T: Clone + Signed> Complex<T> {
161161

162162
#[cfg(any(feature = "std", feature = "libm"))]
163163
impl<T: Float> Complex<T> {
164-
/// Create a new Complex with a given phase -- `exp(i * phase)`
165-
///
166-
/// [cis (mathematics)]: https://en.wikipedia.org/wiki/Cis_(mathematics)
164+
/// Create a new Complex with a given phase: `exp(i * phase)`.
165+
/// See [cis (mathematics)](https://en.wikipedia.org/wiki/Cis_(mathematics)).
167166
#[inline]
168167
pub fn cis(phase: T) -> Self {
169-
(Self::i() * phase).exp()
168+
Self::new(phase.cos(), phase.sin())
170169
}
171170

172171
/// Calculate |self|

0 commit comments

Comments
 (0)