
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 component
of the vector.Declaration
Objective-C
@property (nonatomic, readonly) float x;
Swift
var x: Float { get }
-
Gets the
Y component
of the vector.Declaration
Objective-C
@property (nonatomic, readonly) float y;
Swift
var y: Float { get }
-
Gets the
Z component
of the vector.Declaration
Objective-C
@property (nonatomic, readonly) float z;
Swift
var z: Float { get }
-
Gets the
magnitude
of 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
- (instancetype)initWithX:(float)x y:(float)y z:(float)z;
Swift
init!(x: Float, y: Float, z: Float)
Parameters
x
The
X component
of the vector.y
The
X component
of the vector.z
The
X component
of the vector. -
Creates a new
SCIVector3
object from the anotherSCIVector3
object.Declaration
Objective-C
- (instancetype)initWithVector:(SCIVector3 *)vector;
Swift
init!(vector: SCIVector3!)
Parameters
vector
The specified
SCIVector3
to create vector from. -
Adds two vectors together and stores in current instance.
Declaration
Objective-C
- (void)addVector:(SCIVector3 *)vec1 toVector:(SCIVector3 *)vec2;
Swift
func add(_ vec1: SCIVector3!, to vec2: SCIVector3!)
Parameters
vec1
The first vector.
vec2
The second vector.
-
Subtracts the
vec2
fromvec1
and stores the result in current instance.Declaration
Objective-C
- (void)substractFrom:(SCIVector3 *)vec1 vector:(SCIVector3 *)vec2;
Swift
func substract(from vec1: SCIVector3!, vector vec2: SCIVector3!)
Parameters
vec1
The first vector.
vec2
The second vector.
-
Multiplies a vector by a specified
scalar
.Declaration
Objective-C
- (void)multiplyBy:(float)scalar;
Swift
func multiply(by scalar: Float)
Parameters
scalar
The scalar value.
-
Makes the current vector a normal vector.
Declaration
Objective-C
- (void)normalize;
Swift
func normalize()
-
Computes the
cross product
of two vectors ans stores it.Declaration
Objective-C
- (void)cross:(SCIVector3 *)vec1 with:(SCIVector3 *)vec2;
Swift
func cross(_ vec1: SCIVector3!, with vec2: SCIVector3!)
Parameters
vec1
The first vector.
vec2
The second vector.
-
Computes the
dot product
of self and passed in vector.Declaration
Objective-C
- (float)dot:(SCIVector3 *)vec;
Swift
func dot(_ vec: SCIVector3!) -> Float
Parameters
vec
The vector.
Return Value
The dot product.