Debian Codegraph @

exp/f32/vec3.go

raw symbols SCIP
1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package f32scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/
6
7 import "fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/"
8
9 type Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3# [3]float32
10
11 func (v Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) Stringscip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#String().() string {
12 return fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Sprintf().("Vec3[% 0.3f, % 0.3f, % 0.3f]", v[0], v[1], v[2])
13 }
14
15 func (v *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) Normalizescip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#Normalize().() {
16 sq := v.Dotscip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#Dot().(v)
17 inv := 1 / Sqrtscip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Sqrt().(sq)
18 v[0] *= inv
19 v[1] *= inv
20 v[2] *= inv
21 }
22
23 func (v *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) Subscip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#Sub().(v0, v1 *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) {
24 v[0] = v0[0] - v1[0]
25 v[1] = v0[1] - v1[1]
26 v[2] = v0[2] - v1[2]
27 }
28
29 func (v *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) Addscip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#Add().(v0, v1 *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) {
30 v[0] = v0[0] + v1[0]
31 v[1] = v0[1] + v1[1]
32 v[2] = v0[2] + v1[2]
33 }
34
35 func (v *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) Mulscip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#Mul().(v0, v1 *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) {
36 v[0] = v0[0] * v1[0]
37 v[1] = v0[1] * v1[1]
38 v[2] = v0[2] * v1[2]
39 }
40
41 func (v *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) Crossscip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#Cross().(v0, v1 *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) {
42 v[0] = v0[1]*v1[2] - v0[2]*v1[1]
43 v[1] = v0[2]*v1[0] - v0[0]*v1[2]
44 v[2] = v0[0]*v1[1] - v0[1]*v1[0]
45 }
46
47 func (v *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) Dotscip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#Dot().(v1 *Vec3scip-go gomod golang.org/x/mobile . `golang.org/x/mobile/exp/f32`/Vec3#) float32 {
48 return v[0]*v1[0] + v[1]*v1[1] + v[2]*v1[2]
49 }