C-D(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸŽ€ 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 with atan2(); 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. 🫢

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