šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

github.com/donfrigo/go-math-vector

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/donfrigo/go-math-vector

v0.0.0-20200930155612-026662f00240
Source
Go
Version published
Created
Source

go-math-vector

Simple Go Library implementing basic vector operations

Install by typing:

go get -u github.com/donfrigo/go-math-vector

Usage:

package main

import (
	"fmt"
	vector "github.com/donfrigo/go-math-vector"
)

func main() {
	v1 := vector.New([]float64{3, -3, 1})
	v2 := vector.New([]float64{-12, 12, -4})

	xProduct, err := v1.CrossProduct(v2)
	if err != nil {
		panic(err)
	}
	fmt.Println(xProduct)

	v1 = vector.New([]float64{1, 2, 3})
	v2 = vector.New([]float64{4, -5, 2})
	fmt.Println(v1.DotProduct(v2))
}

Have fun! :)

FAQs

Package last updated on 30 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts