We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c13b8e commit eb44844Copy full SHA for eb44844
src/lib.rs
@@ -161,12 +161,11 @@ impl<T: Clone + Signed> Complex<T> {
161
162
#[cfg(any(feature = "std", feature = "libm"))]
163
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)
+ /// Create a new Complex with a given phase: `exp(i * phase)`.
+ /// See [cis (mathematics)](https://en.wikipedia.org/wiki/Cis_(mathematics)).
167
#[inline]
168
pub fn cis(phase: T) -> Self {
169
- (Self::i() * phase).exp()
+ Self::new(phase.cos(), phase.sin())
170
}
171
172
/// Calculate |self|
0 commit comments