-3
$\begingroup$

I have a vector of four elements. The elements are named x, y, z, w:

Vec4(x, y, z, w)

Now I have another vector of eight elements:

Vec8(x, y, z, w, ?, ?, ?, ?)

Now how do you name the additional elements? What's the best practice for naming?

$\endgroup$
3
  • $\begingroup$ Are p, q, r, s acceptable names? $\endgroup$
    – Megidd
    Feb 18 at 6:23
  • 1
    $\begingroup$ Would $x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8$ work? $\endgroup$
    – JimmyK4542
    Feb 18 at 6:26
  • $\begingroup$ @JimmyK4542 Your suggestion makes more sense. I'm expanding an existing code and I wanted to keep the x,y,z,w thing. But now I think I'd better move away from the previous naming. Thanks :) $\endgroup$
    – Megidd
    Feb 18 at 6:29

1 Answer 1

1
$\begingroup$

I use this, $x=(x_1, \cdots , x_n)$.

Much easier to work with than $(x,y,z,w)$.

$\endgroup$
1
  • 1
    $\begingroup$ Yes. Your approach makes more sense. $\endgroup$
    – Megidd
    Feb 18 at 6:30

Not the answer you're looking for? Browse other questions tagged .