nx_metadata_sdk  1.0
Metadata SDK
vector2d.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2 
3 #pragma once
4 
5 namespace nx {
6 namespace vms_server_plugins {
7 namespace analytics {
8 namespace stub {
9 
10 struct Size
11 {
12  float width = 0;
13  float height = 0;
14 
15  Size() = default;
16  Size(float width, float height);
17 };
18 
19 struct Vector2D
20 {
21  float x = 0;
22  float y = 0;
23 
24  Vector2D() = default;
25  Vector2D(float x, float y);
26 
27  Vector2D operator+(const Vector2D& other) const;
28  Vector2D operator-(const Vector2D& other) const;
29  Vector2D operator*(float scalar) const;
30  Vector2D operator/(float scalar) const;
31 
32  Vector2D& operator+=(const Vector2D& other);
33  Vector2D& operator-=(const Vector2D& other);
34  Vector2D& operator*=(float scalar);
35  Vector2D& operator/=(float scalar);
36 
37  float magnitude() const;
38  void normalize();
39  Vector2D normalized() const;
40 
41  float dotProduct(const Vector2D& other) const;
42 };
43 
44 } // namespace stub
45 } // namespace analytics
46 } // namespace vms_server_plugins
47 } // namespace nx
Definition: apple_utils.h:6