LENGTH(3G)

๐Ÿ“ฆ
version 1.0~svn33624 ยท 4 versions
, in ubuntu jammy, ubuntu noble

LENGTH(3G) ๐Ÿ’–

okay bestie, welcome to LENGTH(3G) โ€” the glow-up era of vector math โœจ this one lives in the 3G manual section and it's literally just vibes about how long a vector is. no cap.


NAME ๐ŸŽ€

length โ€” calculate the length of a vector


DECLARATION ๐Ÿ“œ

here's the tea, the actual signatures, copy them exactly bestie:

float length(genType x);

double length(genDType x);

PARAMETERS ๐ŸŒธ

  • x โ€” the vector you want the length of. that's it. that's the whole assignment. hand it over and it gets measured. ๐Ÿ’…

DESCRIPTION ๐Ÿฆ‹

length returns the length of the vector, i.e. $\sqrt { { x[0] }^2 + { x[1] }^2 + \dots }$.

so yeah, it's squaring every component, adding them all up, and square-rooting the whole situation. iconic behavior honestly. ๐Ÿงฎโœจ


VERSION SUPPORT ๐Ÿ‘‘

the vibe check on which OpenGL Shading Language versions said yes to this function. here's the chart, un-tabled for your scrolling pleasure:

length (genType) โ€” supported everywhere, no skips:

  • 1.10 โ€” โœ”
  • 1.20 โ€” โœ”
  • 1.30 โ€” โœ”
  • 1.40 โ€” โœ”
  • 1.50 โ€” โœ”
  • 3.30 โ€” โœ”
  • 4.00 โ€” โœ”
  • 4.10 โ€” โœ”
  • 4.20 โ€” โœ”
  • 4.30 โ€” โœ”
  • 4.40 โ€” โœ”
  • 4.50 โ€” โœ”

length (genDType) โ€” late bloomer era, showed up fashionably late at 4.00:

  • 1.10 โ€” -
  • 1.20 โ€” -
  • 1.30 โ€” -
  • 1.40 โ€” -
  • 1.50 โ€” -
  • 3.30 โ€” -
  • 4.00 โ€” โœ”
  • 4.10 โ€” โœ”
  • 4.20 โ€” โœ”
  • 4.30 โ€” โœ”
  • 4.40 โ€” โœ”
  • 4.50 โ€” โœ”
ngl the genDType row is giving "arrived at the party at 4.00" energy and we respect the journey ๐Ÿซถ

SEE ALSO ๐Ÿ”

  • distance()
  • normalize()

iykyk, they're the whole squad ๐Ÿ’œ


Copyright ยฉ 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

Copyright ยฉ 2011-2014 Khronos Group


and that's the whole page bestie, no crumbs left ๐Ÿ“

this was served to you from [FIXME: source], dated 01/03/2018, under the title LENGTH(3G) โ€” periodt ๐Ÿ’…โœจ

stay hydrated, go normalize something ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from