Utilities
Radio gyms have utility functions to help on calculating engines and propagation models.
- calculations
- constrants
- converters
Calculations
Calculation untility provides functions for calculations.
- normalize
- point_distance
- vector_angle
- position_between_xz
- vector_inverse
- plane_y_distance
- sort_nearest_points_from_on_plane_y
- calculate_reflection_angle
normalize(vector)
normalize the given vector.
input
- vector: List, input vector.
output
- normalized_vector: List, normalized vector.
point_distance(point_a, point_b)
calculate the distance between given positions.
input
- point_a: List, first input position.
- point_b: List, second input position.
output
- distance: float, distance betwen input positions in meter.
vector_angle(a_dir, b_dir)
calculate the angle between two vector.
input
- a_dir: List, first vector direction.
- b_dir: List, second vector direction.
output
- angle: float, angle between input directions in radian.
position_between_xz(min_x, max_x, min_z, max_z, pos)
check if the position is between the input boundary on y plane.
input
- min_x: float, minimum bound on x-axis.
- max_x: float, maximum bound on x_axis.
- min_z: float, minimum bound on z-axis.
- max_z: float, maximum bound on z_axis.
- pos: List, check position.
output
- result: boolean, return True if the input position is between the boundary.
vector_inverse(vector)
inverse the given input
input
- vector: List, input vector
output
- inversed_vector: List, inversed vector
plane_y_distance(pos_a, pos_b)
calculate the distance between given positions on y plane.
input
- pos_a: List, first input position.
- pos_b: List, second input position.
ouput
- distance: float, distance between pos_a and pos_b on y plane.
sort_nearest_points_from_on_plane_y(ref_pos, points)
sort the given points based on plane y from a reference point.
input
- res_pos: List, reference point
- points: List[List], list of positions
output
- sorted_points: List[List], sorted points from the nearest points to the given ref_pos.
calculate_reflection_angle(tx_pos, ref_pos, rx_pos)
calculate the reflected ray to the normal of the reflecting surface.
input
- tx_pos: List, transmitting position
- ref_pos: List, reflecting position
- rx_pos: List, receiving position
output
- angle: float, angle between reflected ray to normal ray
Constrants
Constraints are used between computing modules.
EPSILON
Epsilon is a small value nearly to 0, mainled used in the ray tracing engine.
- default: 0.0000001
MIN_FLT
Minimum float number.
- default: depends on the operating system
MAX_FLT
Maximum float number.
- default: depends on the operating system
MIN_ROOF_EDGE_DISTANCE
Minimum distance between roof edges, used for merging edges.
ROOF_MIN_ANGLE
Minimum angle between double ray scanning
- default: 0.0017
ROOF_MAX_SCAN
Maximum number of possible scan for edge scanning
- default: 20
LIGHT_SPEED
Light speed
- default: 299792458
Converters
outdoor_traced_result_to_line(result)
convert the result object to list of line.
input
- result: Object, the ray tracing result object
output
- lines, List[List], list of lines
dbm_to_mw(dbm_value)
convert dBm to mW;
input
- dbm_value: float, number in dBm
ouput
- mW_value: float, number in milli-Watt
mw_to_dbm(mw_value)
convert mW to dBm.
input
- mw_value: float, number in mW
output
- dbm_value: float, number in dBm