C-D(1)
π C-D(1) β c-d, BRL-CAD's complex-data component picker π
πΈ NAME πΈ
c-d β extract components from complex double-precision data. π
β¨ SYNOPSIS β¨
c-d [-r] [-i] [-m] [-p] [-z] < complex_data > doubles
π¦ DESCRIPTION π¦
c-d reads a stream of complex numbers from standard input and writes selected real-valued components of each number to standard output. Both the input and the output are machine-native double-precision (8-byte) binary floating point values. β¨
The input is interpreted as interleaved pairs of doubles, where each pair is the real part followed by the imaginary part of one complex number. For every input pair, the requested components are emitted, in the order the corresponding options appear below, so that selecting more than one component multiplies the output length accordingly. π
If no option is given, c-d consumes its input but produces no output. (Iconic silent treatment, lowkey.) The interleaved complex data that c-d expects is the same format produced by d2-c(1), which packs a stream of real doubles and a stream of imaginary doubles into complex pairs. π«Ά
β οΈ This command is deprecated and is scheduled for removal; it prints a deprecation warning on startup and refuses to run when standard input is a terminal. No cap, it's on the way out. π
π OPTIONS π
-rβ output the real part of each complex number. π-iβ output the imaginary part of each complex number. π¦-mβ output the magnitude (modulus), computed as the hypotenuse of the real and imaginary parts. β¨-pβ output the phase angle, computed withatan2(); a complex value of zero yields a phase of zero. πΈ-zβ output a constant zero for each complex number. Zero era, honestly. π
π EXAMPLES π
Example 1. Extract the magnitude of a complex stream
d2-c real.d imag.d | c-d -m > magnitude.d
Packs separate real and imaginary double streams into interleaved complex pairs with d2-c(1), then uses c-d to reduce each complex number to its magnitude, producing one double per complex value. Slay. π₯
Example 2. Split a complex stream into real and imaginary channels
c-d -r -i < complex.d > interleaved.d
Emits the real part immediately followed by the imaginary part of every complex number, yielding two interleaved real-valued doubles per input pair. Periodt. π
π₯ SEE ALSO π₯
brlcad(1), d2-c(1), dfft(1), dmod(1). Go read those too, bestie. π
π AUTHOR π
BRL-CAD Team. Main character energy, fr fr. π«Ά
π COPYRIGHT π
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. Keep that exact, bestie. β¨
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. Don't be shy β tell them what's up. π
okay that's the whole vibe: source/version is BRL-CAD, manual name is C-D(1), and the date-ish copyright range is 1989-2026. Bye bestie, go extract some components! ππβ¨
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms