Monthly Archives: November 2015

Platonic Solids Part 5: Cube and octahedron

You may recall from the first article in this series (Platonic Solids Part 1: What are the Platonic solids?) that each platonic solid has a dual. The cube and octahedron are duals of each other. To make a dual from … Continue reading

Posted in algorithms, graphics, mathematics, wpf | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

Platonic Solids Part 4: The octahedron

Finding the Octahedron’s Vertices A platonic octahedron has six triangular faces. Because the edges of the triangles all have the same length, the triangles are equilateral triangles. If an equilateral triangle has edges of length 1, then its height is … Continue reading

Posted in algorithms, graphics, mathematics, wpf | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Platonic Solids Part 3: The cube

A platonic cube has six square faces. The cube’s symmetry makes it easy to find the coordinates of its vertices. For a cube with edge lengths of 1, the vertex coordinates are (±0.5, ±0.5, ±0.5) as shown in Figure 1. … Continue reading

Posted in algorithms, graphics, mathematics, wpf | Tagged , , , , , , , , , , , , , , , , , , | 5 Comments

Platonic Solids Part 2: The tetrahedron

A tetrahedron has four faces that are equilateral triangles. In an equilateral triangle, the sides have the same lengths and they meet at 60 degree angles. Figure 1 shows a tetrahedron. Finding the Tetrahedron’s Vertices It is a trigonometric fact … Continue reading

Posted in algorithms, graphics, mathematics, wpf | Tagged , , , , , , , , , , , , , , , , , , | 5 Comments

Platonic Solids Part 1: What are the Platonic solids?

This is the first in a series of posts about the Platonic solids. These posts will show how to find the corners of six Platonic solids: tetrahedron, cube (hexahedron), octahedron, dodecahedron, and icosahedron. Deriving these values requires only algebra and … Continue reading

Posted in algorithms, graphics, mathematics, wpf | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments

Add and remove pictures in an Excel worksheet

This is another brief foray into VBA programming. When you click the Insert Image button, the following VBA code executes. ‘ Insert a picture at the selection. Sub Button1_Click() Dim filters As String Dim filename As Variant ‘ Define the … Continue reading

Posted in Excel, Office, VBA | Tagged , , , , , , , , , | Leave a comment

Number files in a directory in C#

I recently went on a trip where I took almost a thousand pictures. My phone (which has a pretty good camera) gives the pictures file names such as WP_20151106_22_04_47_Pro.jpg. I wanted an easy way to number files so they have … Continue reading

Posted in directories, files, system | Tagged , , , , , , , , , | Leave a comment

Convert a directory’s files to grayscale in C#

The example Quickly convert an image to grayscale in C# explains how to convert an image to grayscale. This program uses the same technique to convert all of the files in a directory to grayscale. (I needed this to prepare … Continue reading

Posted in files, graphics, image processing | Tagged , , , , , , , , , , , , | Leave a comment

Perform line clipping in C#

The example Perform line trimming in C# shows how to determine what the DrawString method does when the last line of text doesn’t fit horizontally in a formatting rectangle. This example shows how to perform line clipping when the last … Continue reading

Posted in drawing, fonts, graphics | Tagged , , , , , , , , , , , , , | 1 Comment

Perform line trimming in C#

Line trimming lets you determine how drawn text ends when it reaches the end of the available space. For example, the text could stop in the middle of a word or it could stop after the last word that fits … Continue reading

Posted in fonts, graphics | Tagged , , , , , , , , , | 2 Comments