Debian Codegraph @

googleapis/type/quaternion/quaternion.pb.go

raw
1 // Copyright 2026 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by protoc-gen-go. DO NOT EDIT.
16 // versions:
17 // protoc-gen-go v1.26.0
18 // protoc v4.24.4
19 // source: google/type/quaternion.proto
20
21 package quaternion
22
23 import (
24 reflect "reflect"
25 sync "sync"
26
27 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
28 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
29 )
30
31 const (
32 // Verify that this generated code is sufficiently up-to-date.
33 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
34 // Verify that runtime/protoimpl is sufficiently up-to-date.
35 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
36 )
37
38 // A quaternion, represented by four 64-bit floating point values.
39 //
40 // A quaternion is defined as the quotient of two directed lines in a
41 // three-dimensional space or equivalently as the quotient of two Euclidean
42 // vectors (https://en.wikipedia.org/wiki/Quaternion).
43 //
44 // Quaternions are often used in calculations involving three-dimensional
45 // rotations (https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation),
46 // as they provide greater mathematical robustness by avoiding the gimbal lock
47 // problems that can be encountered when using Euler angles
48 // (https://en.wikipedia.org/wiki/Gimbal_lock).
49 //
50 // Quaternions are generally represented in this form:
51 //
52 // w + xi + yj + zk
53 //
54 // where x, y, z, and w are real numbers, and i, j, and k are three imaginary
55 // numbers.
56 //
57 // The naming choice `(x, y, z, w)` comes from the desire to avoid confusion for
58 // those interested in the geometric properties of the quaternion in the 3D
59 // Cartesian space. Other texts often use alternative names or subscripts, such
60 // as `(a, b, c, d)`, `(1, i, j, k)`, or `(0, 1, 2, 3)`, which are perhaps
61 // better suited for mathematical interpretations.
62 //
63 // To avoid any confusion, as well as to maintain compatibility with a large
64 // number of software libraries, the quaternions represented using the protocol
65 // buffer below *must* follow the Hamilton convention, which defines `ij = k`
66 // (i.e. a right-handed algebra), and therefore:
67 //
68 // i^2 = j^2 = k^2 = ijk = −1
69 // ij = −ji = k
70 // jk = −kj = i
71 // ki = −ik = j
72 //
73 // Please DO NOT use this to represent quaternions that follow the JPL
74 // convention, or any of the other quaternion flavors out there.
75 //
76 // Definitions:
77 //
78 // - Quaternion norm (or magnitude): `sqrt(x^2 + y^2 + z^2 + w^2)`.
79 // - Unit (or normalized) quaternion: a quaternion whose norm is 1.
80 // - Pure quaternion: a quaternion whose scalar component (`w`) is 0.
81 // - Rotation quaternion: a unit quaternion used to represent rotation.
82 // - Orientation quaternion: a unit quaternion used to represent orientation.
83 //
84 // A quaternion can be normalized by dividing it by its norm. The resulting
85 // quaternion maintains the same direction, but has a norm of 1, i.e. it moves
86 // on the unit sphere. This is generally necessary for rotation and orientation
87 // quaternions, to avoid rounding errors:
88 // https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions
89 //
90 // Note that `(x, y, z, w)` and `(-x, -y, -z, -w)` represent the same rotation,
91 // but normalization would be even more useful, e.g. for comparison purposes, if
92 // it would produce a unique representation. It is thus recommended that `w` be
93 // kept positive, which can be achieved by changing all the signs when `w` is
94 // negative.
95 type Quaternion struct {
96 state protoimpl.MessageState
97 sizeCache protoimpl.SizeCache
98 unknownFields protoimpl.UnknownFields
99
100 // The x component.
101 X float64 `protobuf:"fixed64,1,opt,name=x,proto3" json:"x,omitempty"`
102 // The y component.
103 Y float64 `protobuf:"fixed64,2,opt,name=y,proto3" json:"y,omitempty"`
104 // The z component.
105 Z float64 `protobuf:"fixed64,3,opt,name=z,proto3" json:"z,omitempty"`
106 // The scalar component.
107 W float64 `protobuf:"fixed64,4,opt,name=w,proto3" json:"w,omitempty"`
108 }
109
110 func (x *Quaternion) Reset() {
111 *x = Quaternion{}
112 if protoimpl.UnsafeEnabled {
113 mi := &file_google_type_quaternion_proto_msgTypes[0]
114 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
115 ms.StoreMessageInfo(mi)
116 }
117 }
118
119 func (x *Quaternion) String() string {
120 return protoimpl.X.MessageStringOf(x)
121 }
122
123 func (*Quaternion) ProtoMessage() {}
124
125 func (x *Quaternion) ProtoReflect() protoreflect.Message {
126 mi := &file_google_type_quaternion_proto_msgTypes[0]
127 if protoimpl.UnsafeEnabled && x != nil {
128 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
129 if ms.LoadMessageInfo() == nil {
130 ms.StoreMessageInfo(mi)
131 }
132 return ms
133 }
134 return mi.MessageOf(x)
135 }
136
137 // Deprecated: Use Quaternion.ProtoReflect.Descriptor instead.
138 func (*Quaternion) Descriptor() ([]byte, []int) {
139 return file_google_type_quaternion_proto_rawDescGZIP(), []int{0}
140 }
141
142 func (x *Quaternion) GetX() float64 {
143 if x != nil {
144 return x.X
145 }
146 return 0
147 }
148
149 func (x *Quaternion) GetY() float64 {
150 if x != nil {
151 return x.Y
152 }
153 return 0
154 }
155
156 func (x *Quaternion) GetZ() float64 {
157 if x != nil {
158 return x.Z
159 }
160 return 0
161 }
162
163 func (x *Quaternion) GetW() float64 {
164 if x != nil {
165 return x.W
166 }
167 return 0
168 }
169
170 var File_google_type_quaternion_proto protoreflect.FileDescriptor
171
172 var file_google_type_quaternion_proto_rawDesc = []byte{
173 0x0a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x71, 0x75,
174 0x61, 0x74, 0x65, 0x72, 0x6e, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b,
175 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x22, 0x44, 0x0a, 0x0a, 0x51,
176 0x75, 0x61, 0x74, 0x65, 0x72, 0x6e, 0x69, 0x6f, 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01,
177 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01,
178 0x28, 0x01, 0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x7a, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01,
179 0x52, 0x01, 0x7a, 0x12, 0x0c, 0x0a, 0x01, 0x77, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01,
180 0x77, 0x42, 0x6c, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
181 0x74, 0x79, 0x70, 0x65, 0x42, 0x0f, 0x51, 0x75, 0x61, 0x74, 0x65, 0x72, 0x6e, 0x69, 0x6f, 0x6e,
182 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
183 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72,
184 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x74,
185 0x79, 0x70, 0x65, 0x2f, 0x71, 0x75, 0x61, 0x74, 0x65, 0x72, 0x6e, 0x69, 0x6f, 0x6e, 0x3b, 0x71,
186 0x75, 0x61, 0x74, 0x65, 0x72, 0x6e, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x47, 0x54, 0x50, 0x62,
187 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
188 }
189
190 var (
191 file_google_type_quaternion_proto_rawDescOnce sync.Once
192 file_google_type_quaternion_proto_rawDescData = file_google_type_quaternion_proto_rawDesc
193 )
194
195 func file_google_type_quaternion_proto_rawDescGZIP() []byte {
196 file_google_type_quaternion_proto_rawDescOnce.Do(func() {
197 file_google_type_quaternion_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_type_quaternion_proto_rawDescData)
198 })
199 return file_google_type_quaternion_proto_rawDescData
200 }
201
202 var file_google_type_quaternion_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
203 var file_google_type_quaternion_proto_goTypes = []interface{}{
204 (*Quaternion)(nil), // 0: google.type.Quaternion
205 }
206 var file_google_type_quaternion_proto_depIdxs = []int32{
207 0, // [0:0] is the sub-list for method output_type
208 0, // [0:0] is the sub-list for method input_type
209 0, // [0:0] is the sub-list for extension type_name
210 0, // [0:0] is the sub-list for extension extendee
211 0, // [0:0] is the sub-list for field type_name
212 }
213
214 func init() { file_google_type_quaternion_proto_init() }
215 func file_google_type_quaternion_proto_init() {
216 if File_google_type_quaternion_proto != nil {
217 return
218 }
219 if !protoimpl.UnsafeEnabled {
220 file_google_type_quaternion_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
221 switch v := v.(*Quaternion); i {
222 case 0:
223 return &v.state
224 case 1:
225 return &v.sizeCache
226 case 2:
227 return &v.unknownFields
228 default:
229 return nil
230 }
231 }
232 }
233 type x struct{}
234 out := protoimpl.TypeBuilder{
235 File: protoimpl.DescBuilder{
236 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
237 RawDescriptor: file_google_type_quaternion_proto_rawDesc,
238 NumEnums: 0,
239 NumMessages: 1,
240 NumExtensions: 0,
241 NumServices: 0,
242 },
243 GoTypes: file_google_type_quaternion_proto_goTypes,
244 DependencyIndexes: file_google_type_quaternion_proto_depIdxs,
245 MessageInfos: file_google_type_quaternion_proto_msgTypes,
246 }.Build()
247 File_google_type_quaternion_proto = out.File
248 file_google_type_quaternion_proto_rawDesc = nil
249 file_google_type_quaternion_proto_goTypes = nil
250 file_google_type_quaternion_proto_depIdxs = nil
251 }