Java Archive

Calculating a log normal value from an average and standard deviation

It’s been a bit quiet round here recently due to project work at the office primarily with little Grasshopper work and little in the way of interesting snippets. However, one which I’ve decided to put here for future use is a function to calculate a log normal value from a given average and a given

Interpolating data points to produce colour maps – code examples

For a lot of the work I do in my research, I need to produce colour maps which can visualise data in a user-friendly way while still getting across the necessary elements of the analysis performed. In my current area of research, looking at wayfinding tools to analyse healthcare building design for natural wayfinding, I’m

Obtaining the angle between two vectors for 360 degrees

This previous post demonstrated how to obtain the angle between two vectors from three geometric points, providing an angle between 0-180 degrees. However, there may be times when you need the angle between 0-360 degrees instead, as I did earlier this week. As such, this post aims to complete the previous with the solution for

Calculating angle between two vectors from geometric points – code solution

Calculating the angle between two vectors is a fairly easy solution to find online – there are plenty of maths help websites which will take you through step by step how to work out the angle, however, not many sites will provide you with the necessary programming code to put this into your software. As

For loops – running method calls in the declaration

For loops are a key part of recursive code, allowing us to iterate over items in a vector, or perform actions a set number of times without repeating the lines of code. We all know how they can be applied and declared, however, something which may not be very well-known is the ability to call

Global keyboard listeners – pros and cons

As discussed previously, event listeners are a key component to GUI development and good software development. Being able to record mouse clicks, or keyboard keys can enhance the usability of software for the end-users. In this post, I intend to show you how to implement a global keyboard listener for C#. What is a global

Inheriting or Inclusion, the differences between both

Many programming languages make use of inheritance and inclusion. For beginner programmers, this can be a daunting concept but once understood, they can open up a world of new possibilities for your software development. This post is aimed at those who have an understanding of programming, but perhaps need or want a little example of

Basic File IO – Java/C#/C++ examples

File Input/Output (FileIO) is a necessary piece of programming for software development where outputs need to be saved, or inputs used for calculations. All pieces of software create, to some degree, data which needs to be output to a permanent source on the file system. These files are not written magically and need to be

C# GUI creation – why it’s easier than Java

For part of my research since January, I’ve been building some software for automated data capture. This includes a C++ DLL (created myself) doing the brunt of the work, with a C# user interface (making use of the built-in WPF libraries that come with Visual Studio), joined at the hip by a CLI interface. Those