PLCALC_WORLD(3plplot)

πŸ’… NAME πŸ’…

okay so plcalc_world β€” it calculates world coordinates and the matching window index from relative device coordinates. literally its whole personality. πŸ¦‹


✨ SYNOPSIS ✨

plcalc_world(rx, ry, wx, wy, window)

πŸŽ€ DESCRIPTION πŸŽ€

bestie, here's the vibe: you hand it relative device coordinates rx and ry, and it hands you back the world coordinates wx and wy, plus the corresponding window index. that's it, that's the tea. πŸ’–

Redacted form: General: plcalc_world(rx, ry, wx, wy, window)

and fun fact: this function is used in example 31. iconic of it, honestly. πŸ‘‘


🌸 ARGUMENTS 🌸

  • rx (PLFLT(3plplot), input) β€” input relative device coordinate (range 0.0-1.0) for the x coordinate. just a lil number in that range, no cap.
  • ry (PLFLT(3plplot), input) β€” input relative device coordinate (range 0.0-1.0) for the y coordinate. same deal, y-flavored. πŸ“
  • wx (PLFLT_NC_SCALAR(3plplot), output) β€” the returned value of the x world coordinate that corresponds to the relative device coordinates rx and ry.
  • wy (PLFLT_NC_SCALAR(3plplot), output) β€” the returned value of the y world coordinate that corresponds to those same relative device coordinates rx and ry.
  • window (PLINT_NC_SCALAR(3plplot), output) β€” the returned value of the last defined window index that corresponds to the input relative device coordinates (and to the returned world coordinates).

okay so the window thing needs a whole lil lore dump, 'cause it's giving main character energy: 🧚

each page starts with the initial window index set to zero, right? and every single time plwind(3plplot) is called within that page, world and device coordinates get stored for the window, and the window index gets incremented. so like, the index is leveling up each time.

so πŸ’« for a simple page layout with non-overlapping viewports and one window per viewport, window corresponds to the viewport index (in the order the viewport/windows were created) of the only viewport/window that corresponds to rx and ry. simple, clean, slay.

but 😭 for more complicated layouts with potentially overlapping viewports and possibly more than one window (set of world coordinates) per viewport, then window and the corresponding output world coordinates correspond to the last window created that fulfills the criterion that the relative device coordinates are inside it. last one wins, periodt.

and finally β€” in all cases where the input relative device coordinates are not inside any viewport/window, then the returned value of the last defined window index is set to -1. so if you get a -1, that's your glow-down signal that your coords weren't in anybody's house. πŸ’€


🫢 AUTHORS 🫢

Many developers (who are credited at http://plplot.sourceforge.net/credits.php) have contributed to PLplot over its long history. honestly? legends, all of them. πŸ‘‘βœ¨


🌈 SEE ALSO 🌈

PLplot documentation at http://plplot.sourceforge.net/documentation.php β€” go read it, iykyk. πŸ“š


fr fr that's the whole page, no notes. now go plot something cute. πŸ’œ

mwah πŸ’‹ β€” this was PLCALC_WORLD(3plplot) from the PLplot API, dated August, 2026. bye bestie, see you in the next manpage! πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from