Skip to content

Commit

Permalink
Init Ray module 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasHassing committed Apr 8, 2016
0 parents commit a51681c
Show file tree
Hide file tree
Showing 16 changed files with 502 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
261 changes: 261 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
# OS X
# https://github.com/github/gitignore/blob/master/Global/OSX.gitignore
.DS_Store
.AppleDouble
.LSOverride
._*
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows
# https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.lnk

# Linux
# https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
*~
.fuse_hidden*
.directory
.Trash-*

# Archives
# https://github.com/github/gitignore/blob/master/Global/Archives.gitignore
*.7z
*.jar
*.rar
*.zip
*.gz
*.bzip
*.bz2
*.xz
*.lzma
*.cab
*.iso
*.tar
*.dmg
*.xpi
*.gem
*.egg
*.deb
*.rpm
*.msi
*.msm
*.msp

# Mono Develop
# https://github.com/github/gitignore/blob/master/Global/MonoDevelop.gitignore
*.userprefs
*.usertasks
*.pidb
*.resources
test-results/

# Netbeans
# https://github.com/github/gitignore/blob/master/Global/NetBeans.gitignore
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
.nb-gradle/

# Sublime Text
# https://github.com/github/gitignore/blob/master/Global/SublimeText.gitignore
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project
sftp-config.json

# TextMate
# https://github.com/github/gitignore/blob/master/Global/TextMate.gitignore
*.tmproj
*.tmproject
tmtags

# Vim
# https://github.com/github/gitignore/blob/master/Global/Vim.gitignore
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
Session.vim
.netrwhist

# Visual Studio Code
# https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
.vscode

# JetBrains
# https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
.idea/dataSources.ids
.idea/dataSources.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
.idea/gradle.xml
.idea/libraries
.idea/mongoSettings.xml
*.iws
/out/
.idea_modules/
atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Visual Studio
# https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
*.suo
*.user
*.userosscache
*.sln.docstates
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
.vs/
wwwroot/
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*.VisualState.xml
TestResult.xml
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.svclog
*.scc
_Chutzpah*
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.psess
*.vsp
*.vspx
*.sap
$tf/
*.gpState
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
.JustCode
_TeamCity*
*.dotCover
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
*.mm.*
AutoTest.Net/
[Ee]xpress/
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
publish/
*.[Pp]ublish.xml
*.azurePubxml
*.pubxml
*.publishproj
*.nupkg
**/packages/*
!**/packages/build/
*.nuget.props
*.nuget.targets
csx/
*.build.csdef
ecf/
rcf/
ApplicationInsights.config
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.[Cc]ache
!*.[Cc]ache/
ClientBin/
~$*
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
orleans.codegen.cs
Generated_Code/
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
*.mdf
*.ldf
*.rdl.data
*.bim.layout
*.bim_*.settings
FakesAssemblies/
*.GhostDoc.xml
.ntvs_analysis.dat
*.plg
*.opt
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
.paket/paket.exe
.fake/
*.sln.iml
22 changes: 22 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)
=====================

Copyright (c) 2016 The Authors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
28 changes: 28 additions & 0 deletions Ray.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{37FC5207-0B3A-48FD-8380-EF172998AE70}") = "Ray", "src\Ray\Ray.xproj", "{9A99BE47-08E1-4A8F-A99C-2931D8950439}"
EndProject
Project("{37FC5207-0B3A-48FD-8380-EF172998AE70}") = "Ray.Test", "test\Ray.Test\Ray.Test.xproj", "{47DA5680-61CC-4138-ABBD-F323BE38F8FE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9A99BE47-08E1-4A8F-A99C-2931D8950439}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A99BE47-08E1-4A8F-A99C-2931D8950439}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A99BE47-08E1-4A8F-A99C-2931D8950439}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A99BE47-08E1-4A8F-A99C-2931D8950439}.Release|Any CPU.Build.0 = Release|Any CPU
{47DA5680-61CC-4138-ABBD-F323BE38F8FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47DA5680-61CC-4138-ABBD-F323BE38F8FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47DA5680-61CC-4138-ABBD-F323BE38F8FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47DA5680-61CC-4138-ABBD-F323BE38F8FE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
11 changes: 11 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"projects": [
"lib",
"src",
"test"
],
"sdk": {
"version": "1.0.0-rc1-update2"
},
"packages": "packages"
}
Binary file added lib/Point/Point.0.0.0.dll
Binary file not shown.
9 changes: 9 additions & 0 deletions lib/Point/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"frameworks": {
"dnx451": {
"bin": {
"assembly": "Point.0.0.0.dll"
}
}
}
}
Binary file added lib/Vector/Vector.0.0.0.dll
Binary file not shown.
9 changes: 9 additions & 0 deletions lib/Vector/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"frameworks": {
"dnx451": {
"bin": {
"assembly": "Vector.0.0.0.dll"
}
}
}
}
15 changes: 15 additions & 0 deletions src/Ray/Ray.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// Copyright (C) 2016 The Authors.
module Ray

open Vector
open Point

type Ray = R of Point * Vector

let make p v =
let d = Vector.normalise v
R(p, d)

let getOrigin (R(p, _)) = p

let getVector (R(_, d)) = d
13 changes: 13 additions & 0 deletions src/Ray/Ray.fsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/// Copyright (C) 2016 The Authors.
module Ray

open Vector
open Point

type Ray

val make : Point -> Vector -> Ray

val getOrigin : Ray -> Point

val getVector : Ray -> Vector
Loading

0 comments on commit a51681c

Please sign in to comment.