Difference between revisions of "Namespace Guide math"

From MINR.ORG WIKI
(Created page with "= math = '''Status: STABLE (safe to use)''' == Functions == <div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;> <div class="mw-collapsible...")
 
Line 3: Line 3:
  
 
== Functions ==
 
== Functions ==
 +
=== Function Categories ===
 
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;>
 
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;>
 +
==== Exponentiation (2) ====
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 +
* Double pow(Double base, Double exponent)
 +
* Double sqrt(Double value)
 
</div></div>
 
</div></div>
 
=== TpData===
 
A data structure to manage teleport destinations that are set by a player positioned at the desired location.
 
 
 
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;>
 
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;>
==== Fields (6) ====
+
==== Rounding/Mapping (3) ====
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
* '''Double x''' : x-coordinate of the teleport destination
+
* Double abs(Double value)
* '''Double y''' : y-coordinate of the teleport destination
+
* Int floor(Double x)
* '''Double z''' : z-coordinate of the teleport destination
+
* Int ceil(Double x)
* '''Float yaw''' : yaw of the teleport destination
 
* '''Float pitch''' : pitch of the teleport destination
 
* '''String world''' : world of the teleport destination
 
 
</div></div>
 
</div></div>
 +
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;>
 +
==== Random (5) ====
 +
<div class="mw-collapsible-content">
 +
'''Type-Bounded'''
 +
* Int randomInt()
 +
* Long randomLong()
 +
* Float randomFloat()
 +
* Double randomDouble()
  
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
+
'''User-Bounded'''
==== Constructors (1) ====
+
* Double random(Double min, Double max)
<div class="mw-collapsible-content">
 
* '''rtp::TpData(Player setter)''' : destination fields are set to match the ''setter''<nowiki>'</nowiki>s position at the time of initialization
 
 
</div></div>
 
</div></div>
 
+
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;>
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
+
==== Trigonometry (14)====
==== Methods (3) ====
 
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
* '''String string()''' : returns a simplified representation of the position held by the structure
+
'''Conversions'''
* '''String tpString()''' : returns a string representation of an anonymous tp call performed by tpHere
+
* Double deg(Double x)
* '''Void tpHere(Player player)''': teleports the ''player'' to the position held by the structure
+
* Double rad(Double x)
</div></div>
 
  
=== Rtp ===
+
'''Basic Functions (Degrees)'''
A TpData list selector and management tool that mimics the /rtp plugin functionality.
+
* Double sin(Double x)
 +
* Double cos(Double x)
 +
* Double tan(Double x)
  
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
+
'''Inverse Functions (Degrees)'''
==== Fields (3) ====
+
* Double arcsin(Double x)
<div class="mw-collapsible-content">
+
* Double arccos(Double x)
* '''String name''' : custom identifier for the set of teleport locations
+
* Double arctan(Double x)
* '''Boolean doLogging''' : flag to enable logging of each use of teleportation
 
* '''rtp::TpData[] tpList''' : list of potential teleport locations
 
</div></div>
 
  
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
+
'''Basic Functions (Radians)'''
==== Constructors (4) ====
+
* Double radsin(Double x)
<div class="mw-collapsible-content">
+
* Double radcos(Double x)
* '''rtp::Rtp()''' : initialize an empty location manager (defaults "UNNAMED", true)
+
* Double radtan(Double x)
* '''rtp::Rtp(String name)''' : initialize a location manager with identifier name set
 
* '''rtp::Rtp(Boolean doLogging)''' : initialize with logging option set
 
* '''rtp::Rtp(String name, Boolean doLogging)''' : initialize with name and logging set
 
</div></div>
 
  
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
+
'''Inverse Functions (Radians)'''
==== Methods (8) ====
+
* Double radarcsin(Double x)
<div class="mw-collapsible-content">
+
* Double radarccos(Double x)
* '''String string()''' : returns a representation of name, logging status, and capacity of the structure
+
* Double radarctan(Double x)
* '''Int count()''' : returns size of the managed location list
 
* '''Void setName(String name)''' : updates the name of the structure
 
* '''Void setLogging(Boolean doLogging)''' : updates the logging status of the structure
 
* '''Void addWarp(Player setter)''' : adds a location generated from ''setter''<nowiki>'</nowiki>s position at the time of the function call
 
* '''Void removeWarp(Int index)''' : removes a location specified by the ''index'' (between 1 and Rtp.count() inclusive)
 
* '''Void useWarp(Player player, Int index)''' : warps the ''player'' to the location specified by ''index'' (1 to count() inclusive), performing optional logging
 
* '''Void rtp(Player player)''' : Selects a location randomly and performs the actions of useWarp using the ''player''
 
 
</div></div>
 
</div></div>

Revision as of 02:28, 30 April 2020

math

Status: STABLE (safe to use)

Functions

Function Categories

Exponentiation (2)

  • Double pow(Double base, Double exponent)
  • Double sqrt(Double value)

Rounding/Mapping (3)

  • Double abs(Double value)
  • Int floor(Double x)
  • Int ceil(Double x)

Random (5)

Type-Bounded

  • Int randomInt()
  • Long randomLong()
  • Float randomFloat()
  • Double randomDouble()

User-Bounded

  • Double random(Double min, Double max)

Trigonometry (14)

Conversions

  • Double deg(Double x)
  • Double rad(Double x)

Basic Functions (Degrees)

  • Double sin(Double x)
  • Double cos(Double x)
  • Double tan(Double x)

Inverse Functions (Degrees)

  • Double arcsin(Double x)
  • Double arccos(Double x)
  • Double arctan(Double x)

Basic Functions (Radians)

  • Double radsin(Double x)
  • Double radcos(Double x)
  • Double radtan(Double x)

Inverse Functions (Radians)

  • Double radarcsin(Double x)
  • Double radarccos(Double x)
  • Double radarctan(Double x)