iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
SCIVector3
@interface SCIVector3 : NSObject
Defines a vector with three single-precision floating-point values.
-
Gets the
X componentof the vector.Declaration
Objective-C
@property (nonatomic, readonly) float x;Swift
var x: Float { get } -
Gets the
Y componentof the vector.Declaration
Objective-C
@property (nonatomic, readonly) float y;Swift
var y: Float { get } -
Gets the
Z componentof the vector.Declaration
Objective-C
@property (nonatomic, readonly) float z;Swift
var z: Float { get } -
Gets the
magnitudeof the vector.Declaration
Objective-C
@property (nonatomic, readonly) float length;Swift
var length: Float { get } -
Creates a vector whose elements have the specified values.
Declaration
Objective-C
- (nonnull instancetype)initWithX:(float)x y:(float)y z:(float)z;Swift
init(x: Float, y: Float, z: Float)Parameters
xThe
X componentof the vector.yThe
X componentof the vector.zThe
X componentof the vector. -
Creates a new
SCIVector3object from the anotherSCIVector3object.Declaration
Objective-C
- (nonnull instancetype)initWithVector:(nonnull SCIVector3 *)vector;Swift
init(vector: SCIVector3)Parameters
vectorThe specified
SCIVector3to create vector from. -
Adds two vectors together and stores in current instance.
Declaration
Objective-C
- (void)addVector:(nonnull SCIVector3 *)vec1 toVector:(nonnull SCIVector3 *)vec2;Swift
func add(_ vec1: SCIVector3, to vec2: SCIVector3)Parameters
vec1The first vector.
vec2The second vector.
-
Declaration
Objective-C
- (void)addWeighted:(nonnull SCIVector3 *)vector weight:(float)weight;Swift
func addWeighted(_ vector: SCIVector3, weight: Float)Parameters
vectorThe vector to add.
weightThe weight to be applied onto
vectorcomponents. -
Subtracts the
vec2fromvec1and stores the result in current instance.Declaration
Objective-C
- (void)substractFrom:(nonnull SCIVector3 *)vec1 vector:(nonnull SCIVector3 *)vec2;Swift
func substract(from vec1: SCIVector3, vector vec2: SCIVector3)Parameters
vec1The first vector.
vec2The second vector.
-
Multiplies a vector by a specified
scalar.Declaration
Objective-C
- (void)multiplyBy:(float)scalar;Swift
func multiply(by scalar: Float)Parameters
scalarThe scalar value.
-
Makes the current vector a normal vector.
Declaration
Objective-C
- (void)normalize;Swift
func normalize() -
Computes the
cross productof two vectors ans stores it.Declaration
Objective-C
- (void)cross:(nonnull SCIVector3 *)vec1 with:(nonnull SCIVector3 *)vec2;Swift
func cross(_ vec1: SCIVector3, with vec2: SCIVector3)Parameters
vec1The first vector.
vec2The second vector.
-
Computes the
dot productof self and passed in vector.Declaration
Objective-C
- (float)dot:(nonnull SCIVector3 *)vec;Swift
func dot(_ vec: SCIVector3) -> FloatParameters
vecThe vector.
Return Value
The dot product.
View on GitHub