Agreed on the Pythagorean solution. Doesn't have to be 345 ratio either (that just the simplest one to recall).
I use a cross line for floor layouts. I put the laser at one end of the space and shoot a line at the opposite wall. Once it's parallel to the reference wall, the cross (plumb) line is perpendicular.
Why a laser, when 345 is so easy? Because there may be obstructions on the start wall (cabinets, stub walls, etc..) that limit the size of the triangle base. It's also easy to reposition solo. If you're laying out a large, complex space for modular flooring (tiles), and want to see where your cuts will break before committing to a particular layout - it's the most efficient method. I've found.
I bought this one, back when it was $70. Have since purchased a 3X360 one with a detector that will do more.