...

Source file src/google.golang.org/genproto/googleapis/type/quaternion/quaternion.pb.go

Documentation: google.golang.org/genproto/googleapis/type/quaternion

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

View as plain text