• Articles
  • Api Documentation
Show / Hide Table of Contents
  • AsyncGPUReadbackPluginNs
    • AsyncGPUReadbackPlugin
    • AsyncGPUReadbackPluginRequest
  • ZO
    • ZOMouseOrbitCamera
  • ZO.Controllers
    • ZO2FingerGripController
    • ZOLinearActuator
    • ZOLinearActuator.Axis
    • ZOServoMotorActuator
  • ZO.Document
    • ZOSerializationInterface
    • ZOSimDocumentRoot
    • ZOSimOccurrence
  • ZO.Math
    • ZOGaussianNoiseModel
    • ZOMathUtil
    • ZOMatrix4x4Util
    • ZORandom
  • ZO.Networking
    • ZOBinaryMessagePublisher
    • ZOBinaryMessageSubscriber
    • ZOJSONMessagePublisher
    • ZOJSONMessageSubscriber
    • ZOPubSubHeader
    • ZOTCPServer
  • ZO.Physics
    • ZOArticulatedBody
    • ZOFixedJoint
    • ZOHingeJoint
    • ZOJointInterface
    • ZOPIDController
    • ZOSpeedLimiter
  • ZO.ROS
    • ZOROSActionServer<TActionMessage, TGoalMessage>
    • ZOROSAPI
    • ZOROSBridgeConnection
    • ZOROSBridgeConnection.ROSBridgeConnectionChangeHandler
    • ZOROSBridgeConnection.SerializationType
  • ZO.ROS.Controllers
    • ControllerStateEnum
    • ZOArmController
    • ZODifferentialDriveController
    • ZOROSControllerInterface
  • ZO.ROS.MessageTypes
    • ZOROSMessageInterface
  • ZO.ROS.MessageTypes.ActionLib
    • ActionStatusEnum
    • GoalIDMessage
    • GoalStatusArrayMessage
    • GoalStatusMessage
    • ZOROSActionGoalMessageInterface
    • ZOROSActionMessageInterface
  • ZO.ROS.MessageTypes.Control
    • FollowJointTrajectoryActionFeedback
    • FollowJointTrajectoryActionGoal
    • FollowJointTrajectoryActionMessage
    • FollowJointTrajectoryActionResult
    • FollowJointTrajectoryFeedback
    • FollowJointTrajectoryGoal
    • FollowJointTrajectoryResult
    • JointToleranceMessage
    • JointTrajectoryControllerStateMessage
  • ZO.ROS.MessageTypes.ControllerManager
    • ControllerStateMessage
    • HardwareInterfaceResourcesMessage
    • ListControllersResponse
    • ListControllerTypesServiceResponse
    • LoadControllerServiceRequest
    • LoadControllerServiceResponse
    • ReloadControllerLibrariesServiceRequest
    • ReloadControllerLibrariesServiceResponse
    • SwitchControllerServiceRequest
    • SwitchControllerServiceResponse
    • UnloadControllerServiceRequest
    • UnloadControllerServiceResponse
  • ZO.ROS.MessageTypes.Gazebo
    • SpawnModelServiceRequest
    • SpawnModelServiceResponse
  • ZO.ROS.MessageTypes.Geometry
    • PointMessage
    • PoseMessage
    • PoseWithCovarianceMessage
    • QuaternionMessage
    • TransformMessage
    • TransformStampedMessage
    • TwistMessage
    • TwistWithCovarianceMessage
    • Vector3Message
  • ZO.ROS.MessageTypes.Nav
    • OdometryMessage
  • ZO.ROS.MessageTypes.ROSAPI
    • GetParamNamesResponse
    • GetParamResponse
    • GetParamServiceRequest
    • HasParamResponse
    • HasParamServiceRequest
    • SetParamServiceRequest
  • ZO.ROS.MessageTypes.ROSGraph
    • ClockMessage
  • ZO.ROS.MessageTypes.Sensor
    • CameraInfoMessage
    • ImageMessage
    • ImuMessage
    • JointStateMessage
    • LaserScanMessage
    • RegionOfInterestMessage
  • ZO.ROS.MessageTypes.Std
    • DurationMessage
    • EmptyServiceRequest
    • EmptyServiceRespone
    • HeaderMessage
    • Int32Message
    • SetBoolServiceRequest
    • SetBoolServiceResponse
    • StringMessage
    • TimeMessage
  • ZO.ROS.MessageTypes.TF2
    • TFMessage
  • ZO.ROS.MessageTypes.Trajectory
    • JointTrajectoryMessage
    • JointTrajectoryPointMessage
  • ZO.ROS.MessageTypes.ZOSim
    • ZOSimDeleteModelRequest
    • ZOSimDeleteModelResponse
    • ZOSimPrefabSpawnRequest
    • ZOSimPrefabSpawnResponse
    • ZOSimSpawnServiceRequest
    • ZOSimSpawnServiceResponse
  • ZO.ROS.Publisher
    • ZOROSImagePublisher
    • ZOROSIMUPublisher
    • ZOROSIMUPublisher.CoordinateSystemEnum
    • ZOROSJointStatesPublisher
    • ZOROSLaserScanPublisher
    • ZOROSRGBDepthPublisher
    • ZOROSStereoImagePublisher
    • ZOROSTransformPublisher
  • ZO.ROS.Unity
    • ZOROSUnityGameObjectBase
    • ZOROSUnityInterface
    • ZOROSUnityManager
    • ZOROSUnityManager.ROSBridgeConnectionChangeHandler
  • ZO.ROS.Unity.Docker
    • ZOROSLaunchParameters
  • ZO.ROS.Unity.Service
    • ZOControllerManagerService
    • ZOSimDeleteModelService
    • ZOSimPrefabSpawnService
    • ZOSimResetSimulationService
    • ZOSimSpawnService
  • ZO.Sensors
    • ZOContactDetector
    • ZOContactSwitchDualChannel
    • ZOIMU
    • ZOLIDAR2D
    • ZOLIDAR3D
    • ZOLIDAR3D.ReferenceFrame
    • ZORaycastJobBatch
    • ZORGBCamera
    • ZORGBDepthCamera
    • ZORGBDepthCamera.FrameOutputType
  • ZO.Util
    • ZOCenterOfMass
    • ZOClock
    • ZODocker
    • ZODocker.VolumeMapEntry
    • ZODockerRunParameters
    • ZODrawArc
    • ZODrawCircle
    • ZOEarthUtils
    • ZOEarthUtils.GeoPoint
    • ZOEarthUtils.HomeGeoPoint
    • ZOFrequencyCounter
    • ZOFrequencyCounter.TimeSourceType
    • ZOGameObjectBase
    • ZOMagnetometer
    • ZOMoveTest
    • ZOMoveTest.MoveTypeEnum
    • ZORandomizePhysics
    • ZORandomizeTransform
    • ZOReadOnlyAttribute
    • ZOSystem
    • ZOTurnOffSelfCollision
  • ZO.Util.Extensions
    • ZOJSONExtensions
  • ZO.Util.Rendering
    • ZOAsyncGPUReadbackPlugin
    • ZOAsyncGPUReadbackPluginRequest

Class ZOMathUtil

Inheritance
System.Object
ZOMathUtil
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZO.Math
Assembly: Unity.ZeroSim.dll
Syntax
public static class ZOMathUtil

Methods

| Improve this Doc View Source

cartesianToPolar(Vector2)

Convert 2d cartesian coordinates to polar coordinates.

Declaration
public static Vector2 cartesianToPolar(Vector2 point)
Parameters
Type Name Description
UnityEngine.Vector2 point

2D point

Returns
Type Description
UnityEngine.Vector2

2D polar coordinates.

| Improve this Doc View Source

DegreesToRadians(Double)

Convert double degrees to radians.

Declaration
public static double DegreesToRadians(double degrees)
Parameters
Type Name Description
System.Double degrees

Input angle in degrees.

Returns
Type Description
System.Double

Output angle in radians.

| Improve this Doc View Source

FindOrthonormals(Vector3, out Vector3, out Vector3)

Get the orthonormal basis given a start vector.

Declaration
public static void FindOrthonormals(Vector3 normal, out Vector3 orthonormal1, out Vector3 orthonormal2)
Parameters
Type Name Description
UnityEngine.Vector3 normal

The start vector.

UnityEngine.Vector3 orthonormal1

The first ortho normal vector to the start vector.

UnityEngine.Vector3 orthonormal2

The second ortho normal vector to the start vector and the first ortho vector.

| Improve this Doc View Source

FindQuaternionTwist(Quaternion, Vector3)

Calculate the quaternion twist about an axis. https://stackoverflow.com/questions/3684269/component-of-a-quaternion-rotation-around-an-axis

Declaration
public static float FindQuaternionTwist(Quaternion q, Vector3 axis)
Parameters
Type Name Description
UnityEngine.Quaternion q

The quaternion.

UnityEngine.Vector3 axis

The axis.

Returns
Type Description
System.Single

The twist in radians.

| Improve this Doc View Source

isApproximatelyEqual(Double, Double, Double)

Checks if two double values are approximately equal.

Declaration
public static bool isApproximatelyEqual(double a, double b, double tolerance = 4.94065645841247E-324)
Parameters
Type Name Description
System.Double a

First value.

System.Double b

Second value.

System.Double tolerance

The epsilon cut off.

Returns
Type Description
System.Boolean
| Improve this Doc View Source

isApproximatelyZero(Double, Double)

Checks if a value is approximately zero given an epsilon.

Declaration
public static bool isApproximatelyZero(double a, double tolerance = 4.94065645841247E-324)
Parameters
Type Name Description
System.Double a

The value

System.Double tolerance

The epsilon cut off.

Returns
Type Description
System.Boolean

True if zero otherwise false.

| Improve this Doc View Source

lowPassFilter(Single, Single, Single)

Simple low pass filter on float.

Declaration
public static float lowPassFilter(float currentValue, float prevValue, float alpha)
Parameters
Type Name Description
System.Single currentValue

The current value.

System.Single prevValue

The previous value.

System.Single alpha

Weight 0..1 where greater value biases towards the current value.

Returns
Type Description
System.Single

Weighted value.

| Improve this Doc View Source

lowPassFilter(Vector3, Vector3, Single)

Simple low pass filter on Vector3

Declaration
public static Vector3 lowPassFilter(Vector3 currentValue, Vector3 prevValue, float alpha)
Parameters
Type Name Description
UnityEngine.Vector3 currentValue

The current value.

UnityEngine.Vector3 prevValue

The previous value.

System.Single alpha

Weight 0..1 where greater value biases towards the current value.

Returns
Type Description
UnityEngine.Vector3

Weighted value.

| Improve this Doc View Source

lowPassFilter(Vector3, ref Vector3, Single, Boolean)

Declaration
public static Vector3 lowPassFilter(Vector3 targetValue, ref Vector3 intermediateValueBuf, float factor, bool init)
Parameters
Type Name Description
UnityEngine.Vector3 targetValue
UnityEngine.Vector3 intermediateValueBuf
System.Single factor
System.Boolean init
Returns
Type Description
UnityEngine.Vector3
| Improve this Doc View Source

lowPassFilterQuaternion(Quaternion, Quaternion, Single, Boolean)

Declaration
public static Quaternion lowPassFilterQuaternion(Quaternion intermediateValue, Quaternion targetValue, float factor, bool init = false)
Parameters
Type Name Description
System.Numerics.Quaternion intermediateValue
System.Numerics.Quaternion targetValue
System.Single factor
System.Boolean init
Returns
Type Description
System.Numerics.Quaternion
| Improve this Doc View Source

RadiansToDegrees(Double)

Converts double radians to degrees.

Declaration
public static double RadiansToDegrees(double angle)
Parameters
Type Name Description
System.Double angle

Input angle in radians.

Returns
Type Description
System.Double

Outpus angle in degrees.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX